M
markb
Hello,
I am using this code to disable insertion and deletion of rows/columns:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
Dim cBut As CommandBarControl
Dim iPostion As Integer
On Error Resume Next
Application.CommandBars("Cell").Controls("CLEAR ALL").Delete
With Application.CommandBars("Cell")
iPostion = .Controls("Delete...").Index
Set cBut = .Controls.Add(Before:=iPostion, Temporary:=True)
.Controls("Delete...").Delete
.Controls("insert...").Delete
With cBut
.Caption = "CLEAR ALL"
.OnAction = "ClearAll"
End With
End With
On Error GoTo 0
End Sub
I need to restore these to the shortcut menu when the application closes. I
can not seem to get the syntax right.
Please help?
Thanks,
I am using this code to disable insertion and deletion of rows/columns:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
Dim cBut As CommandBarControl
Dim iPostion As Integer
On Error Resume Next
Application.CommandBars("Cell").Controls("CLEAR ALL").Delete
With Application.CommandBars("Cell")
iPostion = .Controls("Delete...").Index
Set cBut = .Controls.Add(Before:=iPostion, Temporary:=True)
.Controls("Delete...").Delete
.Controls("insert...").Delete
With cBut
.Caption = "CLEAR ALL"
.OnAction = "ClearAll"
End With
End With
On Error GoTo 0
End Sub
I need to restore these to the shortcut menu when the application closes. I
can not seem to get the syntax right.
Please help?
Thanks,