1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| Sub test()
Dim numero As Integer
Dim ColSyn As Integer
numero = 1
ColSyn = 1
For RowSyn = 1 To 1500
For ligne = 1 To Sheets("f2").Cells(Rows.Count, 1).End(xlUp).Row
If "*" & Sheets("f1").Cells(RowSyn, ColSyn).Value & "*" Like "*" & Sheets("f2").Cells(ligne, 1).Value & "*" Then 'compare les colonnes pour voir si ils sont identiques
If "*" & Sheets("f1").Cells(RowSyn, ColSyn + 1).Value & "*" Like "*" & Sheets("f2").Cells(ligne, 2).Value & "*" Then
Sheets("f1").Cells(RowSyn + Rowx, ColSyn + Rowy).Interior.Color = RGB(0, 220, 0)
Sheets("f1").Cells(RowSyn + Rowx, ColSyn + Rowy + 1).Interior.Color = RGB(0, 220, 0)
Sheets("f2").Cells(ligne, 1).Interior.Color = RGB(0, 220, 0)
Sheets("f2").Cells(ligne, 2).Interior.Color = RGB(0, 220, 0)
End If
End If
Next
'End Ifexc
'Next
Next
End Sub |
Partager