Computer Science, asked by mishrajagannath711, 4 months ago

Write two advantages of select case?​

Answers

Answered by djoshuanoeldjnoel
1

Answer:

What is the benefit of using Select Case over If-Then in Excel VBA?

Brad Yundt

Answered 3 years ago

I prefer to use Select Case over If Then when there are more than two alternatives. The Select Case is easier to understand, especially when a case covers multiple possible values or a range of values.

Select Case X

Case 1, 2, 3, 4 'List as many possibilities as you like

'Do stuff

Case 5 - 8

'Do different stuff

Case 9

'Do something else

Case Else

'Handle the exceptions here

End Select

Similar questions