为什么这段代码缩短为1行,Code有效,但想整合它。
'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
答案 0 :(得分:1)
我真的不明白你的问题......
你的意思是喜欢使用Or?
If ActiveSheet.CodeName = "VPL" Or ActiveSheet.CodeName = "VBA_BlankBidSheet" Or ActiveSheet.CodeName = "VBA_BlankOptionSheet" Or ActiveSheet.CodeName = "VBA_Dropdowns" Then Exit Sub