Conditional Statement Select Case

Select Case

 

The other method of checking for single or multiple conditions is the Select Case Function. This is another method used for decision making based on a condition or criteria. It, in my opinion, is much better than If etc. This has the syntax

 

Select Case <Expression to test>

Case <Test1>

Do something

Case <Test2>

Do something

Case Else

Do something else

End Select

Select Case Range(“A1”).Value

Case 100

Range(“B1”).Value = 50

Case 200

Range(“B1”).Value = 10

Case Else

Range(“B1”).Value = 20

End Select