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 :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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".

Voila, merci a ceux qui essayeront de m'aider.