bonjour
je voudrai comparer des cellules dans des feuilles differantes:
(cf la ligne:
If Range("B" & i) = Sheets("feuil2").Range(B1) Then
mais ma maro se plante ...
Dim i As Integer, j As Integer, newfactnb As Integer
Sheets("feuil1").Activate
newfactnb = Application.Max(Columns("L:L")) + 1
i = 2
j = 1
Do Until Range("L" & i) = ""
i = i + 1
Loop
Rows(i).Copy (Sheets("feuil2").Range("A" & j))
Range("L" & i).Activate
ActiveCell = newfactnb
i = i + 1
j = j + 1
Do
Do Until Range("L" & i) = ""
i = i + 1
Loop
If Range("B" & i) = Sheets("feuil2").Range(B1) Then
Rows(i).Copy (Sheets("feuil2").Range("A" & j))
Range("L" & i).Activate
ActiveCell = newfactnb
i = i + 1
j = j + 1
End If
Loop
merci d'avance
je voudrai comparer des cellules dans des feuilles differantes:
(cf la ligne:
If Range("B" & i) = Sheets("feuil2").Range(B1) Then
mais ma maro se plante ...
Dim i As Integer, j As Integer, newfactnb As Integer
Sheets("feuil1").Activate
newfactnb = Application.Max(Columns("L:L")) + 1
i = 2
j = 1
Do Until Range("L" & i) = ""
i = i + 1
Loop
Rows(i).Copy (Sheets("feuil2").Range("A" & j))
Range("L" & i).Activate
ActiveCell = newfactnb
i = i + 1
j = j + 1
Do
Do Until Range("L" & i) = ""
i = i + 1
Loop
If Range("B" & i) = Sheets("feuil2").Range(B1) Then
Rows(i).Copy (Sheets("feuil2").Range("A" & j))
Range("L" & i).Activate
ActiveCell = newfactnb
i = i + 1
j = j + 1
End If
Loop
merci d'avance