Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
Application.DisplayHeadings = False
Application.CutCopyMode = False
Application.CellDragAndDrop = False
Application.CommandBars("Ply").Enabled = False
If Selection.Rows.Count > 1 Then 'pour éviter sélection multiple/effacements/modifs
Range("A4").Select
Else
End If
Dim ddate As Date
'*********************************************************************************************************************************
'If Not Intersect(Range("B:B,H:H,I:I"), Target) Is Nothing And Target.Count = 1 Then --> pas besoin car cellules verrouillées :)
' Range("A4").Select --> pas besoin car cellules verrouillées :)
'End If --> pas besoin car cellules verrouillées :)
'*********************************************************************************************************************************
If Target.Columns.Count = Columns.Count Or Target.Rows.Count = Rows.Count Then
Application.EnableEvents = False
Application.Undo ' --> mettre un "On Error Resume Next" pour éviter débogage...
Application.EnableEvents = True
End If
'---------------------------------------------------------------------------------------------------------------------------------
If Target.Row > 4 And Target.Row - 3 <= [t_BDD].ListObject.ListRows.Count And Cells(Target.Row, 8) <> "" And Target.Count = 1 Then
ddate = Format(Cells(Target.Row, 8), "dd/mm/yyyy")
If ddate < Date Then
Range("A4").ClearContents
Range("A4").Select
End If
End If
fin:
End Sub