bonjour,
j ai ce code :
For i = 5 To 2
For n = 2 To derlin1
For m = 2 To derlin2
a = Left(Sheets('Feuil1').Range('A' & n), i) & Sheets('Feuil1').Range('B' & n)
b = Left(Sheets('Feuil2').Range('A' & m), i) & Sheets('Feuil2').Range('B' & m)
If a = b And Sheets('Feuil2').Cells(m, 3).Value = '' Then
Sheets('Feuil2').Range('C' & m) = Sheets('Feuil1').Range('C' & n)
Sheets('Feuil2').Range('D' & m) = Sheets('Feuil1').Range('A' & n)
Sheets('Feuil2').Range('E' & m) = Sheets('Feuil1').Range('B' & n)
End If
Next m
Next n
Next i
mais qd je compile, visiblement, VBA ne m'accepte pas la ligne : For i = 5 To 2. Par contre il m accepte For i = 2 to 5.
Comment lui imposer la premiere solution ?
Merci
j ai ce code :
For i = 5 To 2
For n = 2 To derlin1
For m = 2 To derlin2
a = Left(Sheets('Feuil1').Range('A' & n), i) & Sheets('Feuil1').Range('B' & n)
b = Left(Sheets('Feuil2').Range('A' & m), i) & Sheets('Feuil2').Range('B' & m)
If a = b And Sheets('Feuil2').Cells(m, 3).Value = '' Then
Sheets('Feuil2').Range('C' & m) = Sheets('Feuil1').Range('C' & n)
Sheets('Feuil2').Range('D' & m) = Sheets('Feuil1').Range('A' & n)
Sheets('Feuil2').Range('E' & m) = Sheets('Feuil1').Range('B' & n)
End If
Next m
Next n
Next i
mais qd je compile, visiblement, VBA ne m'accepte pas la ligne : For i = 5 To 2. Par contre il m accepte For i = 2 to 5.
Comment lui imposer la premiere solution ?
Merci