Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Jerusalem, Israel
    Posts
    708
    Thanks
    0
    Thanked 1 Time in 1 Post

    Case Select (xp/2003)

    How can I use a case select to select "like" or not. Is it the equivalent of what the where statement would look like? Would something like the following work?

    select Case x
    case not (972)*
    ...
    case *(1)*
    .....
    end select

    Thanks
    Zave

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Case Select (xp/2003)

    Select Case doesn't work with Like. You can use a series of Ifs and ElseIfs:

    If x Not Like "(972)*" Then
    ...
    ElseIf x Like "*(1)*"
    ...
    End If

  3. #3
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Case Select (xp/2003)

    Or you can use the famous "Select Case True" technique. Sample:<pre>Select Case True
    Case x Not Like "(972)*"
    ...
    Case x Like "*(1)*"
    .....
    End Select</pre>


Posting Permissions

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