【问题标题】:If active sheet code name equals then exit sub如果活动工作表代码名称等于然后退出子
【发布时间】:2016-10-21 19:44:57
【问题描述】:

为什么这段代码被缩短到 1 行,代码可以工作但想整合它。

'If active sheet has the code name below then exit this sub

If ActiveSheet.CodeName = "VPL" Then Exit Sub
If ActiveSheet.CodeName = "VBA_BlankBidSheet" Then Exit Sub
If ActiveSheet.CodeName = "VBA_BlankOptionSheet" Then Exit Sub
If ActiveSheet.CodeName = "VBA_Dropdowns" Then Exit Sub

【问题讨论】:

标签: excel vba


【解决方案1】:

我真的不明白你的问题......

你的意思是喜欢使用 Or?

If ActiveSheet.CodeName = "VPL" Or ActiveSheet.CodeName = "VBA_BlankBidSheet" Or ActiveSheet.CodeName = "VBA_BlankOptionSheet" Or ActiveSheet.CodeName = "VBA_Dropdowns" Then Exit Sub

【讨论】:

    猜你喜欢
    • 2021-10-27
    • 1970-01-01
    • 2023-04-03
    • 1970-01-01
    • 2021-04-29
    • 1970-01-01
    • 2011-02-18
    • 1970-01-01
    • 2012-10-03
    相关资源
    最近更新 更多