bonjour a ceux qui voudront bien m'aider.
Voila j'ai un niveau moyen - en VBA, et j'essaye de coder une macro, mais j'ai cette erreur Incompatibilité de type qui me fait ... j'sais bien quoi, et que je n'arrive pas à résoudre.
Je vous joint ma macro :
Sub report()
Dim Rang, RangA As Long
Dim Cellule, CelluleA As Range
Dim DébitB, DébitA, CréditB, CréditA As Double
For Each Cellule In Sheets("ECR").Range("e13:e999")
Rang = Cellule.Row
DébitB = Sheets("ecr").Range("h" & Rang)
CréditB = Sheets("ecr").Range("I" & Rang)
If Not IsNull(DébitB) Or (CréditB) Then
For Each CelluleA In Workbooks("00- Sommaire Général").Sheets("BAL").Range("b14:b1000")
If Not IsEmpty(CelluleA) Then
RangA = CelluleA.Row
DébitA = Workbooks("00- Sommaire Général").Sheets("BAL").Range("I" & RangA) + DébitB
Workbooks("00- Sommaire Général").Sheets("BAL").Range("I" & RangA) = DébitA
CréditA = Workbooks("00- Sommaire Général").Sheets("BAL").Range("j" & RangA) + CréditB
Workbooks("00- Sommaire Général").Sheets("BAL").Range("j" & RangA) = CréditA
End If
Next CelluleA
End If
Next Cellule
End Sub
Le but de cette macro est de reporter les valeurs d'une feuille "ECR", dans la feuille "BAL" du workbook "00- Sommaire général".
Je travaille sur excel 2010.
Voila, merci a ceux qui essayeront de m'aider.