Barboza Babcock
New Member
- Joined
- Jul 3, 2020
- Messages
- 13
- Office Version
- 365
- Platform
- Windows
I've looked at a bunch of code for the Select Case statement. Probably not able to do this.
Is there a way to evaluate whether to go into a case base on a criteria other than the case?
I'm guessing that the overriding factor is whether strYes ="Yes", and you can't do what I want.
Before I edited the code to a bunch of if then elseif statements I thought I would put this out there.
As always, thanks for taking a look!
Is there a way to evaluate whether to go into a case base on a criteria other than the case?
Code:
Dim strYes as string, strNo as string
strYes = "Yes"
strNo= "Do not go into this case"
Select case strYes
case strYes is = "Yes" AND strNo = "Yes"
'Only get to here if the case selection criteria(strYes) and the value of the variable (strNo) are both set to yes.
'In this example should not get here.
End Select
strYes="Don't go in"
strNo = "Yes"
Select case strYes
Case strYes is = "Yes" or strNo ="Yes"
'Should get in here if one or the other value is true. Even if the case selection value (strYes)
'Probably not possible??
End Select
I'm guessing that the overriding factor is whether strYes ="Yes", and you can't do what I want.
Before I edited the code to a bunch of if then elseif statements I thought I would put this out there.
As always, thanks for taking a look!