' *** Dans le module ThisWorkbook ***
Private Sub Workbook_Open()
Init Selection
End Sub
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Init Selection
End Sub
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If P.Address <> A Then
Application.EnableEvents = False
Application.Undo
Application.EnableEvents = True
End If
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Init Target
End Sub
Private Sub Workbook_WindowActivate(ByVal Wn As Window)
Init Selection
End Sub
' *** Dans un module standard ***
Public P As Range
Public A As String
Public Sub Init(T As Range)
Set P = T
A = P.Address
End Sub