excel vba在选择情况下调用多个子例程

问题描述

| 如果我有以下代码
Select Case Number

  Case 1: Call Subroutine1()
  Case 2: Call Subroutine2()
  Case 3: Call Subroutine3()
  Case 4: Call Subroutine4()
  Case 5: Call Subroutine5()
  Case 6: Call Subroutine6()

End Select
我想在情况1中调用几个子例程: 怎么做到呢? 最好,美国     

解决方法

        
Select Case Number

  Case 1: 
    Call Subroutine1a()
    Call Subroutine1b()
    Call Subroutine1c()

  Case 2: Call Subroutine2()
  Case 3: Call Subroutine3()
  Case 4: Call Subroutine4()
  Case 5: Call Subroutine5()
  Case 6: Call Subroutine6()

End Select
    ,        像这样:
Select Case Number

  Case 1: 
      Call Subroutine1a()
      Call Subroutine1b()
  Case 2: Call Subroutine2()
  Case 3: Call Subroutine3()
  Case 4: Call Subroutine4()
  Case 5: Call Subroutine5()
  Case 6: Call Subroutine6()

End Select
    ,        您可以根据需要在每个Case匹配中包含任意数量的语句;
Select Case Number
  Case 1
    Call Subroutine1()
    Call Subroutine2()
  Case 2: Call Subroutine2()
  ...