- Joined
- Aug 16, 2002
- Messages
- 6,081
- Office Version
- 365
- Platform
- Windows
Is there a way of capturing a delete column? According to the help, a Worksheet_Change will ignore it.. is there anything else I can try?
thanks
thanks
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim SeeControl As Boolean
If Target.Column = 1 Or Target.Row = 2 Then
SeeControl = False
Else: SeeControl = True
End If
If Selection.Columns.Count = 256 Then ActiveCell.Select
If Selection.Rows.Count = 65536 Then ActiveCell.Select
Application.CommandBars("Column").Controls("&Delete...").Enabled = SeeControl
Application.CommandBars("Row").Controls("&Delete...").Enabled = SeeControl
Application.CommandBars("Cell").Controls("&Delete...").Enabled = SeeControl
Application.CommandBars("Ply").Controls("&Delete").Enabled = SeeControl
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Columns.Count = 256 Or Target.Rows.Count = 65536 Then Application.Goto Range(Cells(Target.Row, Target.Column), Cells(Target.Row, Target.Column))
End Sub