Negate a Select Case Statement

  • Thread starter Thread starter Lucas Tam
  • Start date Start date
L

Lucas Tam

How do I do the following?


Select Case(SomeValue)

Case NOT A, M, Q, Y
'Do stuff if it is not A,M,Q,Y
End Select


Currently I have

Select Case(Somevalue)
Case A, M, Q, Y

Case Else
'Do Stuff
End Select

But surely NOT must work? I also tried Case IS <> A, M, Q, Y but that
doesn't seem to work properly.

Thanks.
 
Select Case(SomeValue)
Case A, M, Q, Y
'Do stuff for this
Default
'Do stuff not in any other case
End Select

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
 
Select Case(SomeValue)
Case A, M, Q, Y
'Do stuff for this
Default
'Do stuff not in any other case
End Select

But I want to negate A, M, Q, Y.

So do stuff when NOT A, M, Q,Y.

I guess I'll stick with the Case Else for now.
 
Select Case(SomeValue)
Case A, M, Q, Y
'Do stuff for this
Default
'Do stuff not in any other case
End Select

Attention Security Personnel: C# user detected in grid 7. Annihilate!
 
Try this:

Select case (somevalue)
case is <> A, is <> B, .......
Do you thing here
case something else

End Select
 
dont annhilate him - turn him - with a double agent in the camp maybe we could find out what C# *** really *** keeps inside its curly braces!

guy
 
Hi Lucas,


Select Case(SomeValue)
Case A, M, Q, Y
'Do nothing
Case Else
'Do your stuff
End Select

I hope this helps?

Cor
 
Back
Top