helloakshay
New Member
Hi All
The user inputs a value and based on that there is some action like diffrent message boxes for different input values
Want to know if there is any simple way to write the below code. I have more than twenty such choices like "AB", "BC"......................... and so on.
Even in case statement i assume we need to write for each option
case "AB"
Do something
case "CD"
Do something
Instead of writing for each option is there any simpler way
[/CODE]
Dim pc As Variant
pc = InputBox("enter your choice")
If pc = "AB" Or "CD" Then
MsgBox "1234"
ElseIf pc = "EF" Or "GH" Then
MsgBox "4567"
Else
MsgBox "8910"
End If
The user inputs a value and based on that there is some action like diffrent message boxes for different input values
Want to know if there is any simple way to write the below code. I have more than twenty such choices like "AB", "BC"......................... and so on.
Even in case statement i assume we need to write for each option
case "AB"
Do something
case "CD"
Do something
Instead of writing for each option is there any simpler way
[/CODE]
Dim pc As Variant
pc = InputBox("enter your choice")
If pc = "AB" Or "CD" Then
MsgBox "1234"
ElseIf pc = "EF" Or "GH" Then
MsgBox "4567"
Else
MsgBox "8910"
End If