+ Reply to Thread
Results 1 to 8 of 8

Noob: Case select & Statement

  1. #1
    Registered User
    Join Date
    03-24-2014
    Location
    Kingman, az
    MS-Off Ver
    Excel 2013
    Posts
    49

    Noob: Case select & Statement

    I have a case select that I use in another spreadsheet. I am trying to edit it to work for my current one. What I need to do is add an & statement. Meaning if C2 Case Is < 46.1 & D2 Case Is < 6 arrStore(StoreIndex) = "A"

    Currently this is what I have

    Please Login or Register  to view this content.
    Last edited by dohara; 04-28-2014 at 10:07 PM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Noob: Case select & Statement

    Try something like this...

    Please Login or Register  to view this content.
    NOTE: varZip is a Range type object if you want to declare it as a Range instead of Variant
    Last edited by AlphaFrog; 04-28-2014 at 06:52 PM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    03-24-2014
    Location
    Kingman, az
    MS-Off Ver
    Excel 2013
    Posts
    49

    Re: Noob: Case select & Statement

    I tried below, and have an issue. It is stopping at the first case. I like where you were going with it.

    Please Login or Register  to view this content.
    Last edited by dohara; 04-28-2014 at 10:06 PM.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Noob: Case select & Statement

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    Edit your previous posts and add code tags.


    This is the code you edited
    Please Login or Register  to view this content.
    Which is not like the code I suggested.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    01-25-2011
    Location
    Virginia
    MS-Off Ver
    Excel 2016
    Posts
    166

    Re: Noob: Case select & Statement

    You can't use multiple variables in select case unless you use the select case true construct as shown by alpha frog.

    Tom

  6. #6
    Registered User
    Join Date
    03-24-2014
    Location
    Kingman, az
    MS-Off Ver
    Excel 2013
    Posts
    49

    Re: Noob: Case select & Statement

    I realize it is not exactly what you wrote as I had to edit it. I am having the same issue. I am sure you can see what I need it to do. What is the issue?

    Please Login or Register  to view this content.

  7. #7
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Noob: Case select & Statement

    Thank you for the code tags. Well done.

    Try something like this. It's not tested and I don't know if I got all your logic correct, but you should get a sense of the syntax used.

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    03-24-2014
    Location
    Kingman, az
    MS-Off Ver
    Excel 2013
    Posts
    49

    Re: Noob: Case select & Statement

    Perfect! It worked. I cam up with one that was a lot more work, complicated and a pain in the rear. I'm going to stick with yours! Thank you very much!!!!!!!

    If you would by chance take a look at my other thread to see if you can help point me in a direction. Thanks.
    http://www.excelforum.com/excel-prog...roup-noob.html




    Also, here is what I did on my own before you got yours to work, just so you can see how much you helped me out.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 PM
  2. Select Case Statement
    By Gos-C in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-13-2008, 09:34 AM
  3. Select Case Statement
    By Gos-C in forum Excel Programming / VBA / Macros
    Replies: 31
    Last Post: 06-18-2008, 09:00 AM
  4. Select Case Statement Help
    By Jeugo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-27-2006, 03:45 PM
  5. select case statement
    By jrd269 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-03-2005, 12:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1