Select-Case statement, also called as Switch Case in some other languages, checks a variable for different cases or values. If anyone of the case becomes true then the respective case is executed and the program ignores all other cases.

For example when you have call to a customer care, in the very beginning you have some recorded messages like “for billing support press 1, for technical support press 2, to go back to main menu press 9 and so on…” how this concept work ?

it is just an example of Select Case or Switch case where each key is bind with some selective operations.


Select Case test_expression

Case condition_1



Case condition_2


Case condition_n


Case Else


End Select


Consider that we have the score obtain by engineering student in his academic exam stored in Cell A1. Now on the base of that score we have to print status as given-

Sub MyChoice()

Dim score As Integer

score = Range(“A1”).Value

Select Case score

Case Is >= 80

result = “very good”

Case Is >= 70

result = “good”

Case Is >= 605

result = “average”

Case Else

result = “poor”

End Select

author image

About admin

You Might Also Like...

Cascading style sheet
Excel Macro Training Details
Excel Length Formula

Leave a Reply

Your email address will not be published.

Enjoy the tutorial? Please spread the word :)

Follow by Email