Macro Excel en Appscript pour Google Sheet

Bonjour à tous,

J'aimerais adapter une macro excel sur google sheet mais je ne m'y connais pas assez pour adapter la macro. Quelqu'un pourrait m'aider svp ? Je tiens à préciser que le code ne vient pas de moi je l'ai récupérer sur un vieux forum. Je met le fichier joint si utile.

Voici la macro :

Sub LETTRAGE()
Dim a, i As Long, e
With Sheets("ACTUEL").Cells(1).CurrentRegion
a = .Value
ReDim Preserve a(1 To UBound(a, 1), 1 To UBound(a, 2) + 1)
a(1, 8) = "Lettrage"
With CreateObject("Scripting.Dictionary")
For i = 2 To UBound(a, 1)
If a(i, 6) > 0 Then
If Not .exists(a(i, 7)) Then
Set .Item(a(i, 7)) = CreateObject("Scripting.Dictionary")
End If
.Item(a(i, 7))(i) = a(i, 6)
End If
Next
For i = 2 To UBound(a, 1)
If a(i, 6) < 0 Then
If .exists(a(i, 7)) Then
For Each e In .Item(a(i, 7)).keys
If a(i, 6) + .Item(a(i, 7))(e) = 0 Then
a(i, 8) = "A lettrer": a(e, 8) = "A lettrer"
.Item(a(i, 7)).Remove e: Exit For
End If
Next
End If
End If
Next
End With
With .Columns("h").Resize(UBound(a, 1))
.ClearContents
.Value = Application.Index(a, 0, 8)
End With
End With
End Sub

Rechercher des sujets similaires à "macro appscript google sheet"