Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 1651|回复: 4

[已解决]按一下,使行一个宏然后暂时一下,再按下在使行下个宏。

[复制链接]
发表于 2017-10-7 07:33 | 显示全部楼层 |阅读模式
本帖最后由 爷们679 于 2017-10-11 21:35 编辑

按一下,使行一个宏然后暂时一下,再按下在使行下个宏。
最佳答案
2017-10-7 08:46
参考这个:

Private Sub CommandButton1_Click()
    If CommandButton1.Caption = "程序1" Then
        Call 程序1
        CommandButton1.Caption = "程序2"
    Else
        Call 程序2
        CommandButton1.Caption = "程序1"
    End If
End Sub

0000.zip

417.13 KB, 下载次数: 16

excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
 楼主| 发表于 2017-10-7 08:17 | 显示全部楼层
补充一句。每按一次宏暂时一下。并把按钮中的文字也跟着改。
回复

使用道具 举报

发表于 2017-10-7 08:46 | 显示全部楼层    本楼为最佳答案   
参考这个:

Private Sub CommandButton1_Click()
    If CommandButton1.Caption = "程序1" Then
        Call 程序1
        CommandButton1.Caption = "程序2"
    Else
        Call 程序2
        CommandButton1.Caption = "程序1"
    End If
End Sub

评分

参与人数 1 +3 收起 理由
爷们679 + 3

查看全部评分

回复

使用道具 举报

 楼主| 发表于 2017-10-7 09:41 | 显示全部楼层
本帖最后由 爷们679 于 2017-10-7 20:37 编辑
砂海 发表于 2017-10-7 08:46
参考这个:

Private Sub CommandButton1_Click()

.....
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-4-25 12:12 , Processed in 0.140486 second(s), 13 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表