资源描述:
《VBA自定义菜单如何设置快捷键.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、StaticSubAddMenu()'添加自定义菜单DimNewMenuBarAsCommandBarDimCXAsCommandBarControl,JCAsCommandBarControl,TBAsCommandBarControl,SJAsCommandBarControl,BFAsCommandBarControlDimDYAsCommandBarControl,BZAsCommandBarControl,XXAsCommandBarControl,USEAsCommandBarControl,WHAsCommandBarControlDimCWAsCommandBarControl
2、,TJAsCommandBarControl,LJCAsCommandBarControl,YZ2AsCommandBarControl,YJCAsCommandBarControlDimLDQAsCommandBarControl,LNBAsCommandBarControl,SDQAsCommandBarControl,SNBAsCommandBarControl,LAllAsCommandBarControlDimJSBAsCommandBarControl,SAllAsCommandBarControl,DDQAsCommandBarControl,DNBAsCommandBarCon
3、trol,CDQAsCommandBarControlDimCNBAsCommandBarControl,C0AsCommandBarControl,CTZAsCommandBarControl,BF1AsCommandBarControl,BF2AsCommandBarControlDimBF8AsCommandBarControl,DY1AsCommandBarControl,DY2AsCommandBarControl,SMAsCommandBarControl,FGAsCommandBarControlDimKKAsCommandBarControl,Bh1AsCommandBarCo
4、ntrol,Bh2AsCommandBarControl,JB1AsCommandBarControl,JB2AsCommandBarControlDimKBAsCommandBarControl,FZAsCommandBarControl,SYAsCommandBarControl,CZAsCommandBarControl,Z1AsCommandBarControlDimZ2AsCommandBarControl,NHAsCommandBarControl,B1AsCommandBarControl,B2AsCommandBarControl,B3AsCommandBarControl,B
5、DAsCommandBarControlDimB5AsCommandBarControl,B6AsCommandBarControl,S1AsCommandBarControl,S2AsCommandBarControl,S3AsCommandBarControlDimS5AsCommandBarControl,S6AsCommandBarControl,D1AsCommandBarControl,D2AsCommandBarControl,D3AsCommandBarControlDimD5AsCommandBarControl,D6AsCommandBarControl,C1AsComma
6、ndBarControl,C2AsCommandBarControl,C3AsCommandBarControlDimC5AsCommandBarControl,C6AsCommandBarControl,TJFAsCommandBarControl,TLAsCommandBarControl,CLAsCommandBarControlDimClCellsAsCommandBarControl,ShHLAsCommandBarControl Application.ScreenUpdating=False OnErrorResumeNext MenuBars("MyMenuBar
7、").Delete '定义菜单 SetNewMenuBar=CommandBars.Add(MenuBar:=True) NewMenuBar.Name="MyMenuBar" NewMenuBar.Visible=True '定义一级菜单项 SetCX=NewMenuBar.Controls.Add(Type:=msoControlPopup) CX.C