2014-01-16
展开全部
在单元格右键菜单中添加命令:Sub 添加自定义命令()
On Error Resume Next
Application.CommandBars("CELL").Controls("我的宏").Delete
Dim MC As CommandBarControl
Set MC = Application.CommandBars("CELL").Controls.Add
MC.Caption = "我的宏" '右键菜单中显示的内容
MC.OnAction = "MyMacro" '这是你自己编辑的宏
MsgBox "添加完成!"
End Sub
On Error Resume Next
Application.CommandBars("CELL").Controls("我的宏").Delete
Dim MC As CommandBarControl
Set MC = Application.CommandBars("CELL").Controls.Add
MC.Caption = "我的宏" '右键菜单中显示的内容
MC.OnAction = "MyMacro" '这是你自己编辑的宏
MsgBox "添加完成!"
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询