J
John4bank
How do I set a default value in a switch statement?
I have the following code (this is an abbreviated version of it):
SwitchNum = Switch(x = "P1003On", 1, x = "P1002On", 2, x = "P2022",
3)
The above code works perfectly except for giving me a default value.
I want if x doesn't equal any of these values it to default to equaling 999,
but I am not sure how to set a default value in VBA switch statements. I am a
C++ developer, and am trying to teach myself the syntax of VBA.
Thanks,
John
I have the following code (this is an abbreviated version of it):
SwitchNum = Switch(x = "P1003On", 1, x = "P1002On", 2, x = "P2022",
3)
The above code works perfectly except for giving me a default value.
I want if x doesn't equal any of these values it to default to equaling 999,
but I am not sure how to set a default value in VBA switch statements. I am a
C++ developer, and am trying to teach myself the syntax of VBA.
Thanks,
John