好久不写的VBA代码
来源:互联网 发布:淘宝助手详情批量替换 编辑:程序博客网 时间:2024/05/17 06:20
今天在解决一个问题的时候,使出了很久不用的VBA。这是在Excel里面的一个特殊功能。
下面是代码的一部分,主要是增加和删除快捷菜单
Private Sub Workbook_BeforeClose(Cancel As Boolean)'删除工具条On Error Resume Next Dim bar As CommandBar Set bar = Application.CommandBars("CELL") Dim ctrl As CommandBarControl bar.FindControl(Tag:=12000).DeleteEnd SubPrivate Sub Workbook_Open()'添加工具条 Dim bar As CommandBar Set bar = Application.CommandBars("CELL") Dim ctrl As CommandBarControl '先判断是否有这个工具条 Dim button As CommandBarControl Set button = bar.Controls.Add(Type:=msoControlButton, temporary:=True) With button .Caption = "打印标识卡" .OnAction = "PrintAction" .Tag = 12000 End WithEnd Sub.csharpcode, .csharpcode pre{font-size: small;color: black;font-family: consolas, "Courier New", courier, monospace;background-color: #ffffff;/*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt {background-color: #f4f4f4;width: 100%;margin: 0em;}.csharpcode .lnum { color: #606060; }其他与业务有关的代码这里就不贴出来了
- 好久不写的VBA代码
- 好久不写了~
- 好久不写呼呼,
- 好久不写blog
- 好久不写了
- 好久不写代码,网上抄了几段代码改了一下实现自己的追书功能
- 好久不写blog了
- 好久不写博客了
- 好久不写ios代码,生疏了,以前的一些方法竟然被启用了,网上着了文章转载
- 好久不写东西的时候,再提笔有些困难。
- 好久没写代码了
- 好久不写博客了哦,
- 好久不写东东了,小结一下
- 好久不写算法,学习积累中!
- VS2005用VBA写的代码注释宏
- 自己写的实用VBA代码合集√
- 闲来无事,写了个房态图,练练好久没有写代码了的手
- 好久没写代码了,手痒
- MOSS 2010:什么是Reusable Workflow
- Spring攻略 第四章
- MOSS 2010:Visual Studio 2010开发体验(8)——Silverlight应用
- 能力测试 数列
- QT中采用信号槽机制实现两个label切换图片的关联
- 好久不写的VBA代码
- 数据库(Oracle)原理及性能调优培训笔记
- memcpy
- Windows Live is designed for you, but maybe not for your browser
- Asp.Net 后台控制div.
- Win7下IE 8内存保护可能导致ActiveX无法安装的问题及其解决方法
- hibernate annotation
- MTOM以及在WCF中的应用
- 如何访问嵌套母版页中的控件