Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect([K2:W2], Target) Is Nothing Then
D = 7 * Target + DateSerial(2011, 1, 3) - Weekday(DateSerial(2011, 1, 3)) - 4 ', rien = samedi, -1 = vendredi, -2 = jeudi, -3 = mercredi, -4 = mardi, -5 = lundi, -6 = dimanche
If Target.Comment Is Nothing Then Target.AddComment
Target.Comment.Text Text:=Format(D, "dddd dd mmm yyyy")
Target.Comment.Shape.TextFrame.AutoSize = True
Next C
End If
'ICI ANNEE 2011 ET 2012
If Not Intersect([X2:Y2,AE2:AS2], Target) Is Nothing Then
D = 7 * Target + DateSerial(2012, 1, 3) - Weekday(DateSerial(2012, 1, 3)) - 4 ', rien = samedi, -1 = vendredi, -2 = jeudi, -3 = mercredi, -4 = mardi, -5 = lundi, -6 = dimanche
If Target.Comment Is Nothing Then Target.AddComment
Target.Comment.Text Text:=Format(D, "dddd dd mmm yyyy")
Target.Comment.Shape.TextFrame.AutoSize = True
Next C
End If
End Sub