软件:EXCEL
版本:2010
平常我有个习惯 将常用的宏新增到工具列 VBA如下:
Sub NowToolbar2015()
Dim Toolbar As CommandBar
On Error Resume Next
Application.CommandBars("MyToolbar").Delete
Set Toolbar = Application.CommandBars.Add( _
Name:="MyToolbar", Position:=msoBarTop)
With Toolbar
.Protection = msoBarNoResize
.Visible = True
With .Controls.Add(Type:=msoControlPopup)
.Caption = "资产负债表"
.FaceId = ""
.BeginGroup = True
.OnAction = ""
.Style = msoButtonIconAndCaptionBelow
With .Controls.Add(Type:=msoControlButton)
.Caption = "现金"
.FaceId = ""
.OnAction = "宏1"
End With
With .Controls.Add(Type:=msoControlButton)
.Caption = "应收帐款"
.FaceId = ""
.OnAction = "宏2"
End With
End With
With .Controls.Add(Type:=msoControlPopup)
.Caption = "损益表"
.FaceId = ""
.BeginGroup = True
.OnAction = ""
.Style = msoButtonIconAndCaptionBelow
With .Controls.Add(Type:=msoControlButton)
.Caption = "销售收入"
.FaceId = ""
.OnAction = "宏3"
End With
With .Controls.Add(Type:=msoControlButton)
.Caption = "销货成本"
.FaceId = ""
.OnAction = "宏4"
End With
End With
End With
End Sub
请问有没有办法可以将这样的指令 赋予新增到右键的快显功能中
当然原本的快显功能不变
谢谢