Anne Troy
MrExcel MVP
- Joined
- Feb 18, 2002
- Messages
- 2,632
- Office Version
- 365
- Platform
- Windows
If I have the range as column C, why does this also work when I accidentally click on column A or B?
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("C2:C300")) Is Nothing Then
Application.enableEvents = False
If ActiveCell.Value = "X" Then
ActiveCell.ClearContents
Else
ActiveCell.Value = "X"
ActiveCell.Offset(0, 2).Copy
End If
Cancel = True
End If
Application.enableEvents = True
End Sub