Select Case statements can lead to errors when the test expression in the Select Case line doesn't yield a true result for any of its individual Case expressions. Therefore, you should always use a Case Else as the final Case within a Select Case statement. This sample raises a custom error when an application invokes the Select Case statement with an operation other than the four basic ones:
Select Case Operation
Case "Addition"
Computer2 = dblNumber1 + _
dblNumber2
Case "Subtraction"
Computer2 = dblNumber1 - _
dblNumber2
Case "Multiplication"
Computer2 = dblNumber1 * _
dblNumber2
Case "Division"
Computer2 = dblNumber1 / _
dblNumber2
Case Else
Err.Raise 1, , "Wrong operation."
End Select