+ Reply to Thread
Results 1 to 7 of 7

Case < > "Value", but Add "Value2" in the same case.. dude..

  1. #1
    Registered User
    Join Date
    06-06-2012
    Location
    Mexico
    MS-Off Ver
    Excel 2010
    Posts
    99

    Case < > "Value", but Add "Value2" in the same case.. dude..

    Hi!! Good Morning!

    I have a doubt in using the following macro:

    Please Login or Register  to view this content.
    Works fine in the case <> "PZ".
    But I require also add that if you have "MT", leave it valid.

    If I add the macro function:

    Please Login or Register  to view this content.
    But it doesn't work, any ideas?

    Thank you!
    Best Regards!!

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Case < > "Value", but Add "Value2" in the same case.. dude..

    Just add it below it. That the great thing about Select/Case

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-06-2012
    Location
    Mexico
    MS-Off Ver
    Excel 2010
    Posts
    99

    Re: Case < > "Value", but Add "Value2" in the same case.. dude..

    Dear Sr:

    If I add this case

    Please Login or Register  to view this content.
    Highlight the 2 options: "MT" & "PZ", but I need to Highlight Only the different values to "MT" & "PZ"..
    Help! :S
    thanks again!
    Best Regards!!

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Case < > "Value", but Add "Value2" in the same case.. dude..

    You can just list the criteria.
    Please Login or Register  to view this content.
    Mind you, as far as I can see the code is going to colour every cell red as your Cases have the same result.

  5. #5
    Registered User
    Join Date
    06-06-2012
    Location
    Mexico
    MS-Off Ver
    Excel 2010
    Posts
    99

    Re: Case < > "Value", but Add "Value2" in the same case.. dude..

    Hi Norie:

    mm.. maybe I didn't express correctly..

    I'm only need to highlight the different values that "MT" and "PZ".
    "MT" is one option, and "PZ" is other option, if in my column have different values that this 2 options, highlight the cell in red..


  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Case < > "Value", but Add "Value2" in the same case.. dude..

    I'm afraid it isn't clear.

    Your original code formats cells in column D red if they are "" or not equal to "PZ".

    What exactly do you want to add to that?

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,344

    Re: Case < > "Value", but Add "Value2" in the same case.. dude..

    PZ isn't MT so you'll get red. MT isn't PZ so you'll get red. In fact, anything you put in won't be one or the other, so you'll get red.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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