Mega Code Archive

 
Categories / VisualBasic Script / Application
 

Adding a new item to the Cell shortcut menu

Sub AddToShortCut()     Dim Bar As CommandBar     Dim NewControl As CommandBarButton     DeleteFromShortcut     Set Bar = Application.CommandBars("Cell")     Set NewControl = Bar.Controls.Add(Type:=msoControlButton, ID:=1,temporary:=True)     With NewControl         .Caption = "&Change Case"         .OnAction = "ChangeCase"         .Style = msoButtonIconAndCaption     End With End Sub