Hi all
I have created a sub to add new controls to the "Cell" shortcut menu. Can I remove the standard "Cell" shortcut menu controls? if so how do you do it?
Sub AddToShortCut()
' Adds move command to shortcutmenu
Application.CommandBars("Cell").Enabled = False
Dim Bar As CommandBar
Dim NewControl As CommandBarButton
ResetAllBar
Set Bar = Application.CommandBars("Cell")
'Add move to scratch control
Set NewControl = Bar.Controls.Add _
(Type:=msoControlButton, ID:=21, _
temporary:=True)
With NewControl
.Caption = "&Move to Scratch"
.OnAction = "Move_To_Scratch"
.Style = msoButtonIconAndCaption
End With
'Add Copy Selection control
Set NewControl = Bar.Controls.Add _
(Type:=msoControlButton, ID:=19, _
temporary:=True)
With NewControl
.Caption = "&Copy Selection"
.OnAction = "Copy1"
.Style = msoButtonIconAndCaption
End With
'Add paste selection control
Set NewControl = Bar.Controls.Add _
(Type:=msoControlButton, ID:=997, _
temporary:=True)
With NewControl
.Caption = "&Paste selection"
.OnAction = "Paste1"
.Style = msoButtonIconAndCaption
End With
'Add selection control
Set NewControl = Bar.Controls.Add _
(Type:=msoControlButton, ID:=374, _
temporary:=True)
With NewControl
.Caption = "&Select Trip"
.OnAction = "Select_Trip"
.Style = msoButtonIconAndCaption
End With
'Add delete control
Set NewControl = Bar.Controls.Add _
(Type:=msoControlButton, ID:=9523, _
temporary:=True)
With NewControl
.Caption = "&Delete Trip"
.OnAction = "Delete1"
.Style = msoButtonIconAndCaption
End With
Application.Calculation = xlCalculationManual 'Turn off calculation
End Sub
Bookmarks