Select Case mistake
#4
Quote:Cannot have multiple conditions in "CASE IS".

That's not quite right.  You just won't generate the answers you're expecting, I don't imagine. 

Code: (Select All)
For num = 1 To 100
    Select Case num
        Case Is > 50, Is < 70
            'Do what you need to do
            Print num,
    End Select
Next

Multiple CASE IS statements seem to work as OR comparisons and not AND comparisons.  In this case it's basically IF num >50 OR num < 70, which is all our numbers...  

Looks like TO is the solution for numbers in a range.  Smile
Reply


Messages In This Thread
Select Case mistake - by Kernelpanic - 11-07-2022, 09:09 PM
RE: Select Case mistake - by mnrvovrfc - 11-07-2022, 09:19 PM
RE: Select Case mistake - by SMcNeill - 11-07-2022, 09:35 PM
RE: Select Case mistake - by SMcNeill - 11-07-2022, 09:29 PM
RE: Select Case mistake - by Pete - 11-07-2022, 09:41 PM
RE: Select Case mistake - by SMcNeill - 11-07-2022, 09:45 PM
RE: Select Case mistake - by Pete - 11-07-2022, 09:52 PM
RE: Select Case mistake - by mnrvovrfc - 11-07-2022, 10:14 PM
RE: Select Case mistake - by Pete - 11-07-2022, 10:20 PM
RE: Select Case mistake - by mnrvovrfc - 11-07-2022, 10:27 PM
RE: Select Case mistake - by Kernelpanic - 11-07-2022, 10:21 PM
RE: Select Case mistake - by Kernelpanic - 11-07-2022, 10:36 PM
RE: Select Case mistake - by Kernelpanic - 11-08-2022, 02:57 PM
RE: Select Case mistake - by Pete - 11-08-2022, 03:28 PM
RE: Select Case mistake - by SMcNeill - 11-08-2022, 03:58 PM
RE: Select Case mistake - by Pete - 11-08-2022, 04:17 PM
RE: Select Case mistake - by Kernelpanic - 11-08-2022, 04:21 PM
RE: Select Case mistake - by Pete - 11-08-2022, 04:28 PM
RE: Select Case mistake - by Kernelpanic - 11-08-2022, 04:28 PM



Users browsing this thread: 14 Guest(s)