Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("F10:F65")) Is Nothing Then ' Plage "F10:F65" à modifier
' On fige tout
Application.ScreenUpdating = False ' on fige l'écran
Application.Calculation = xlCalculationManual ' calcul non automatique
Application.EnableEvents = False ' on blowue tout event
Application.DisplayAlerts = False ' on bloque les alertes.
' Prog
Range("I10:I65").NumberFormat = "mmm yy"
Range("F10:F65").NumberFormat = "dd mmm yy"
For L = 10 To 65
If Cells(L, "F") = "" Then
Cells(L, "I") = " "
ElseIf Cells(L, "F") < Now() Then
Cells(L, "I") = "=DATE(YEAR(RC[-3])+VALUE(LEFT(RC[-1],1)),MONTH(RC[-3]),DAY(RC[-3]))"
End If
Next L
End If
' On remet tout
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
Application.DisplayAlerts = True
End Sub