分享

VBA Excel 创建菜单栏 工具栏

 昵称7665211 2014-02-05

VBA Excel 创建菜单栏 工具栏

Option Explicit

Sub ComReset() '删除 "我的工具栏" 菜单
    Application.CommandBars("我的工具栏").Delete
End Sub

Sub 新建工具栏()
    Application.CommandBars.Add(Name:="我的工具栏").Visible = True '新建一个自定义工具栏,名为我的工具栏,并可见。
    Application.CommandBars("我的工具栏").Controls.Add Type:=msoControlButton, ID:=3, Before:=1 '添加保存按钮,在第一个位置
    Application.CommandBars("我的工具栏").Controls.Add Type:=msoControlButton, ID:=1849, Before:=2 '添加查找按钮,在第二个位置
    Application.CommandBars("我的工具栏").Controls.Add Type:=msoControlButton, ID:=295, Before:=3 '添加插入单元格按钮
    Application.CommandBars("我的工具栏").Controls.Add Type:=msoControlButton, ID:=395, Before:=4  '添加货币样式按钮
End Sub

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多