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 29 30 31 32
|
Sub comparaison()
Dim i As Long, j As Long, plagehebdo As Range, plagejour As Range
Sheets("Hebdo").Select
Set plagehebdo = Sheets("Hebdo").Range("A6:A" & Range("A65356").End(xlUp).Row)
For Each nom1 In plagehebdo
i = nom1.Row
heure1 = Sheets("Hebdo").Range("C" & i)
heure1 = Format(heure1, "hh:mm")
Sheets("Jour").Select
Set plagejour = Sheets("Jour").Range("B3:B" & Range("B65356").End(xlUp).Row)
For Each nom2 In plagejour
plagejour.Select
j = nom2.Row
heure2 = Sheets("Jour").Range("J" & j)
heure2 = Format(heure2, "hh:mm")
If nom1 = nom2 And heure1 <> heure2 Then
Range("J" & j).Interior.ColorIndex = 6 'Colorie en Jaune la cellule
Exit For
End If
Next nom2
Sheets("Hebdo").Select
Next nom1
End Sub |
Partager