Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Select case using NOT operator (97)

    Select case using NOT operator
    I

  2. #2
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Select case using NOT operator (97)

    The correct syntax would be:

    <pre>Case Is <> "Dir", Is <> "Mgr", Is <> "Coord"</pre>

    But I don't think that's what you want, because ANY string evaluated will equate to true, including "Dir", etc. Shouldn't it be AND separating the items, not OR?? You may try this instead:
    <pre>If strA <> "Dir" And strA <> "Mgr" And strA <> "Coord" Then
    MsgBox "True.", vbInformation, "TRUE"
    Else
    MsgBox "False.", vbInformation, "FALSE"
    End If</pre>

    Replace "strA" with your string variable to test this.

    HTH

  3. #3
    4 Star Lounger
    Join Date
    Jun 2001
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Select case using NOT operator (97)

    Yes that was more along the lines of what I was looking for, thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •