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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
Sub Surlignage()
Dim i As String
Dim Plage As Range
Dim Cellule As Range
Dim Posit As Long
Dim Jalon0 As Integer
Dim Jalon1 As Integer
Dim Jalon2 As Integer
Dim Jalon3 As Integer
Dim Jalon4 As Integer
Dim Jalon5 As Integer
Dim Jalon6 As Integer
On Error Resume Next
Set Plage = Sheets("Planning").Range(Cells(1, 2), Cells(426, 15))
For Set Plage = Sheets("Planning").Range(Cells(4, 2), Cells(426, 15)) 'Plage où se trouvent mes jalons
If Cellule.Value <> "J0" Then ' Récupération de la position des jalons
Jalon0 = "J0"
End If
If Cellule.Value <> "J1" Then
Jalon1 = "J1"
End If
If Cellule.Value <> "J2" Then
Jalon2 = "J2"
End If
If Cellule.Value <> "J3" Then
Jalon2 = "J3"
End If
If Cellule.Value <> "J4" Then
Jalon2 = "J4"
End If
If Cellule.Value <> "J5" Then
Jalon2 = "J5"
End If
If Cellule.Value <> "J6" Then
Jalon2 = "J6"
End If
For i = 1 To 5
If DateDiff("y",Date(Now()),Date(Range(Jaloni))<>0 Then ' Si la date d'aujourd'hui ne correspond pas
Target.Interior.Color.Index = 44 ' à la date du jalon 1: surligner couleur 44
End If
If DateDiff("y",Date(Now()),date(Jj))=0 Then 'Si la date d'ajourd'hui correspond à jalon1:
Target.Interior.Color.Index = 50 ' surligner couleur 50
End If
Next
Next
End Sub |
Partager