+ Reply to Thread
Results 1 to 2 of 2

If 4 cells have specific values then x; Select Case?

  1. #1
    Registered User
    Join Date
    04-04-2015
    Location
    Vancouver, Canada
    MS-Off Ver
    Office 365
    Posts
    88

    If 4 cells have specific values then x; Select Case?

    I'm not sure how to do this.

    I have 4 cells in range A1:D1
    These cells can be either A, B, C, or D.

    I need to find out if:
    A = B = C = D then x = 1
    A = B = C (OR) B = C = D then x = 1
    A = B (AND) C = D then x = 2
    A = B (AND) C <> D then x = 3
    B = C (AND) A <> D then x = 4
    C = D (AND) A <> B then x = 5
    A <> B <> C <> D then x = 6

    What is a good method to get these x values?
    I tried using select case, but I didn't get the values I want...
    If statement made it super long.. or atleast the way I did it...

    Can you help?

  2. #2
    Forum Contributor LokeshKumar's Avatar
    Join Date
    03-31-2015
    Location
    India
    MS-Off Ver
    All, mostly 2010 now..
    Posts
    471

    Re: If 4 cells have specific values then x; Select Case?

    Hey
    try this.....Sample ifelse.xlsm

    *******hey there is change in code......I have edited the code here..

    Please Login or Register  to view this content.
    Last edited by LokeshKumar; 05-04-2015 at 08:22 AM.
    Lokesh Kumar
    Stay Hungry.. Stay Foolish..
    _________________________________________________________
    Please Click STAR to Add Reputation if my/someone's answer helped!

+ 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] How to select all cells to the last cell in a specific column and copy values
    By pasqualebaldi in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-15-2014, 11:44 AM
  2. [SOLVED] how to set select case values from sheet 2 vba code
    By sspreyer in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 08-29-2013, 12:27 PM
  3. [SOLVED] VBA: Select...Case to Print specific sheet only
    By hydz1213 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-28-2013, 02:25 AM
  4. [SOLVED] If Statement - Select Case - refer to specific cells
    By ahilty in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 07-10-2013, 09:58 AM
  5. Replies: 6
    Last Post: 08-10-2011, 07:19 AM

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