Select - Case
Executes one of several groups of statements, depending on the value of an expression.
When using a Select-Case statement always put the most likely candidates at the top of the list. This will help performance.
If you use only one instruction per case you can put the instructions on the same line using a colon.
If you want to execute more than one instruction then put the instructions below the case statement.
You can combine a series of tests in a single case statement by separating them with commas.
If no Case expression matches the value of the identifier than execution continues at the statement following the End Select
Similar to numbers, text values can also be grouped.
The default or when Option Compare Binary is specified is a case sensitive comparison: A < B < Z < a < b < z
This cannot be done
Nested Select-Case
Select Case statements can be nested, as long as each Select Case has a corresponding End Select.
Switch
The SWITCH function returns values based on expressions.
This provides an alternative to the Select-Case.
© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext