Sub CreateShortcut()
DeleteShortcut
Set myBar = CommandBars.Add (Name:="MyShortcut", Position:=msoBarPopup, Temporary:=True)
Set myItem = myBar.Controls.Add(Type:=msoControlButton)
With myItem
.Caption = "&Number Format..."
.OnAction = "ShowFormatNumber"
.FaceId = 1554
End With
Set myItem = myBar.Controls.Add(Type:=msoControlButton)
With myItem
.Caption = "&Alignment..."
.OnAction = "ShowFormatAlignment"
.FaceId = 217
End With
Set myItem = myBar.Controls.Add(Type:=msoControlButton)
With myItem
.Caption = "&Font..."
.OnAction = "ShowFormatFont"
.FaceId = 291
End With
End Sub
Sub ShowFormatNumber()
Application.Dialogs(xlDialogFormatNumber).Show
End Sub
Sub ShowFormatAlignment()
Application.Dialogs(xlDialogAlignment).Show
End Sub
Sub ShowFormatFont()
Application.Dialogs(xlDialogFormatFont).Show
End Sub
|