Convertir une formule Excel sur Google Sheet
Deanerys
-
Deanerys -
Deanerys -
Bonjour,
Grace à un membre de ce forum je voudrais svp convertir sa formule qui fonctionne parfaitement sur excel sur mon fichier google sheets, est-ce possible svp. Merci.
' A mettre sur le module de chaque Feuil2(Nov 23), Feuil3(Dec 23)....etc.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 10 And Target.Row > 14 Then
x = "": nsh = "": nuli = ""
If Target = "CASH divisé X6" And Target.Offset(0, -1) = 1 Or Target = "CASH divisé X3" And Target.Offset(0, -1) Then
If Range("W" & Target.Row) = "Oui" Then Exit Sub 'Si déjà recopier sortir
x = CInt(Right(Target, 1)) - 1
nsh = ActiveSheet.Name
nuli = Target.Row
copierXfois x, nsh, nuli
End If
End If
End Sub
'A mettre dans un module (exemple Module 1 Dans mon exemple je l'ai nommée : lepingou)..
Sub copierXfois(a, b, c)
x = a: nsh = b: nuli = c: maplage = d
'maplage = Range("A" & nuli & ":W" & nuli)
Sheets(nsh).Range("W" & nuli) = "Oui"
abm = Array("Jan", "Fev", "Mars", "Avril", "Mai", "Juin", "Juil", "Aout", "Sept", "Oct", "Nov", "Dec")
m = Left(nsh, Len(nsh) - 3)
num = Right(nsh, 2)
refD = DateSerial(num, 11, 1)
'mois = [a13]
'd = ActiveSheet.Name
po = Application.Match(m, abm, 0)
Application.ScreenUpdating = False
Application.EnableEvents = False
For aj = 1 To x
num = Month(WorksheetFunction.EDate(refD, aj))
nua = Year(WorksheetFunction.EDate(refD, aj))
mon = abm(num - 1)
nua2 = Right(nua, 2)
nosh = mon & " " & nua2
'***************
Range("A" & nuli & ":W" & nuli).Select
Range("W" & nuli).Activate
Selection.Copy
Sheets(nosh).Select
Range("A16").Select
Selection.Insert Shift:=xlDown
Range("F16") = "Done"
Range("I16") = aj + 1
Range("W16") = "Oui"
Sheets(nsh).Select
Next
Application.CutCopyMode = False
Application.ScreenUpdating = True
Application.EnableEvents = True
MsgBox "la ligne est copiée sur les " & x & " suivants.Dernier: " & nosh
Range("A14").Select
End Sub
Windows / Firefox 122.0
1 réponse
-
Bonjour,
Ce n'est pas le même language, donc malheureusement il faut tout reprendre. Il y'a un outil qui existe pour convertir automatiquement mais c'est limité au licences Google Workspace entreprise ou éducation
- https://developers.google.com/apps-script/guides/macro-converter/convert-files?hl=fr
- https://developers.google.com/apps-script/guides/macro-converter/overview?hl=fr
Cdlt.