作者:绿色风
分类:
时间:2022-08-18
浏览:97
楼主 佛山小老鼠 |
- Sub Test()
- On Error Resume Next
- Application.CommandBars("cell").Controls("佛山小老鼠").Delete
- Set cb = Application.CommandBars("cell").Controls.Add(Type:=msoControlPopup, before:=1)
- With cb
- .Caption = "佛山小老鼠"
- With .Controls.Add(Type:=msoControlButton, before:=1)
- .Caption = "签名"
- .FaceId = 31
- .OnAction = "签名2"
- End With
- With .Controls.Add(Type:=msoControlButton, before:=2)
- .Caption = "复位所有右键"
- .FaceId = 35
- .OnAction = "ResetRight2"
- End With
- With .Controls.Add(Type:=msoControlPopup, before:=3)
- .Caption = "日期&时间"
- With .Controls.Add(Type:=msoControlButton, before:=1)
- .Caption = "日期"
- .FaceId = 50
- .OnAction = "日期"
- End With
- With .Controls.Add(Type:=msoControlButton, before:=2)
- .Caption = "时间"
- .FaceId = 33
- .OnAction = "时间"
- End With
- End With
- End With
- End Sub
- Sub ResetRight2()
- Application.CommandBars("cell").Reset
- End Sub
- Sub 签名2()
- Selection = "佛山小老鼠"
- End Sub
- Sub 日期()
- Selection = Format(Date, "mm-dd")
- End Sub
- Sub 时间()
- Selection = Format(Now, "hh:mm")
- End Sub
|
2楼 biaotiger1 |
为方便测试代码,上传一个图片供参考。2012-2-25 0-59-54.jpg |
3楼 水星钓鱼 |
署名作者写的不规范 |
免责声明
有感于原ExcelTip.Net留存知识的价值及部分知识具有的时间限定性因素,
经与ExcelTip.Net站长Apolloh商议并征得其同意,
现将原属ExcelTip.Net的知识帖采集资料于本站点进行展示,
供有需要的人士查询使用,也慰缅曾经的论坛时代。
所示各个帖子的原作者如对版权有异议,
可与本人沟通提出,或于本站点留言,我们会尽快处理。
在此,感谢ExcelTip.Net站长Apolloh的支持,感谢本站点所有人**绿色风(QQ:79664738)**的支持与奉献,特此鸣谢!
------本人网名**KevinChengCW(QQ:1210618015)**原ExcelTip.Net总版主之一