1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
Sub compare()
Dim Wb As Workbook
Dim Ws As Worksheet
Dim Cell1 As Range
Dim Cell2 As Range
Dim Plage As Range
Dim Plage2 As Range
Dim Cont1 As String
Dim Cont2 As String
Set Wb = Workbooks("Classeur2.xlsx")
For Each Ws In Wb.Worksheets
Set Plage = Ws.Columns(2)
Set Plage2 = Ws.Columns(1)
For Each Cell1 In Plage
Set Cont1 = Cell1.Text
For Each Cell2 In Plage2
Set Cont2 = Cell2.Text
If InStr(Cont2, Cont1) > 0 Then Cell2.Interior.ColorIndex = 28
Next Cell2
Next Cell1
Next
End Sub |
Partager