Select Case

Executes one of the several groups of actions, depending on the value of an expression.


  • Expression Specifies a numeric or string expression.


  • Select Case action can be nested. Each nested Select Case action must have a matching End Select action.

  • The "Case Else" is not required, it is a good idea to have a Case Else action in your Select Case block to handle unforeseen values. If no Case expression list matches expression and there is no Case Else action, execution continues at the action following End Select.