JenniferMurphy
Well-known Member
- Joined
- Jul 23, 2011
- Messages
- 2,687
- Office Version
- 365
- Platform
- Windows
I need a Case statement that will be true if a value is >=0 AND <=1. Here's what I have tried, none of which work:
Is there a way to code multiple tests that must all be true (ANDed) on a single Case statement in VBA?
If not, what's the best workaround?
Code:
Case Is >= 0, Is <= 1 'True for all values
Case Is >= 0 and Is <= 1 'Syntax error
Case >= 0 and <= 1 'Syntax error
Case is >= 0 andalso is <= 1 'Syntax error
Case is >= 0, andalso is <= 1 'Syntax error
Is there a way to code multiple tests that must all be true (ANDed) on a single Case statement in VBA?
If not, what's the best workaround?