Results 1 to 4 of 4

Thread: Select Case Question

  1. #1

    Thread Starter
    Hyperactive Member Jupiter-SL9's Avatar
    Join Date
    Apr 2001
    Location
    Porto Alegre
    Posts
    289

    Select Case Question

    hi
    theres a way to sort great and lower in a select case??

    like this:

    Code:
    Select Case x
    case >= 1 and <= 5
    
    case > 6 and < 10
    end select
    HELP!
    If you want to be loved, first love who God gave to you.

    "Se você quer ser amado, primeiro ame quem Deus te deu"

    (Acts 20:35)

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    VB Code:
    1. Select Case x
    2.   Case 1 To 5
    3.     ...
    4.   Case 7 To 9
    5.     ...
    6. End Select
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Hyperactive Member Jupiter-SL9's Avatar
    Join Date
    Apr 2001
    Location
    Porto Alegre
    Posts
    289
    but if:

    Code:
    Select Case x
      Case 1 To 5
        ...
      Case 5 To 9
        ...
    End Select
    where my program will entry?
    If you want to be loved, first love who God gave to you.

    "Se você quer ser amado, primeiro ame quem Deus te deu"

    (Acts 20:35)

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    The first Case statement that evaluates to true is always used.

    So if X were equal to 5 the code in Case 1 to 5 would be used - never the code in Case 5 to 9.

Posting Permissions

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



Click Here to Expand Forum to Full Width