如何用VBA在EXCEL工作表区域的鼠标右键菜单中使用自定义图标
1个回答
展开全部
Sub xq()
Sheet1.Shapes("tb").Copy '复制图标图片
With Application.CommandBars("Cell").Controls.Add(Type:=msoControlButton, before:=1, temporary:=True) '添加右键菜单
.Caption = "MyCommand" '设置标题
.OnAction = "msg" '指定宏
.PasteFace '黏贴标签
End With
End Sub
Sheet1.Shapes("tb").Copy '复制图标图片
With Application.CommandBars("Cell").Controls.Add(Type:=msoControlButton, before:=1, temporary:=True) '添加右键菜单
.Caption = "MyCommand" '设置标题
.OnAction = "msg" '指定宏
.PasteFace '黏贴标签
End With
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |