1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Private Sub Worksheet_Change(ByVal Target As Range)
Set champ = Range("A1").CurrentRegion
If Not Intersect(champ, Target) Is Nothing And Target.Count = 1 Then
Application.EnableEvents = False
Union(Cells(Target.Row + 1, 1).Resize(1, champ.Columns.Count), _
Cells(1, Target.Column).Resize(champ.Rows.Count, 1)).Select
Target.Offset(1, 0).Activate
Application.EnableEvents = True
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Set champ = Range("A1").CurrentRegion
If Not Intersect(champ, Target) Is Nothing And Target.Count = 1 Then
Application.EnableEvents = False
Union(Cells(Target.Row, 1).Resize(1, champ.Columns.Count), _
Cells(1, Target.Column).Resize(champ.Rows.Count, 1)).Select
Target.Activate
Application.EnableEvents = True
End If
End Sub |
Partager