+ Reply to Thread
Results 1 to 7 of 7

Trying to understand IF Else Statements

  1. #1
    Forum Contributor
    Join Date
    01-08-2013
    Location
    Jacksonville, Fl
    MS-Off Ver
    Excel 2016
    Posts
    355

    Trying to understand IF Else Statements

    Hello,

    Can someone take a look at some basic code I wrote and help me figure out what i'm doing wrong.

    I would like for a person to enter 2 colors (red, blue or yellow) to make a new color.

    If they choose any other color they get an error.

    Please Login or Register  to view this content.
    Thank you very much
    Last edited by Justair07; 10-09-2013 at 08:20 PM.

  2. #2
    Forum Contributor
    Join Date
    03-12-2013
    Location
    Chicago, USA
    MS-Off Ver
    Excel 2007
    Posts
    230

    Re: Trying to understand IF Else Statements

    This should work. However, did you want a result if they select the same color in both input boxes?

    Please Login or Register  to view this content.
    Last edited by majosum; 10-09-2013 at 08:45 PM.

  3. #3
    Forum Contributor
    Join Date
    01-08-2013
    Location
    Jacksonville, Fl
    MS-Off Ver
    Excel 2016
    Posts
    355

    Re: Trying to understand IF Else Statements

    Good question, same color should probably be a separate error message.

  4. #4
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,414

    Re: Trying to understand IF Else Statements

    Hi Justair07,
    Here's a code to try :

    Please Login or Register  to view this content.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  5. #5
    Forum Contributor
    Join Date
    03-12-2013
    Location
    Chicago, USA
    MS-Off Ver
    Excel 2007
    Posts
    230

    Re: Trying to understand IF Else Statements

    I edited my code in my original post. Try that now.

  6. #6
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,414

    Re: Trying to understand IF Else Statements

    Just saw the condition to have 2 different colors...
    code slightly modified :

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    01-08-2013
    Location
    Jacksonville, Fl
    MS-Off Ver
    Excel 2016
    Posts
    355

    Re: Trying to understand IF Else Statements

    Thank you guys very much for the help! majosum, I got an error when I entered Red for the first color and blue for the 2nd. It said I entered the same color? GC Excel thank you very much for your help, your code worked great, I was hoping to add an error message instead of a repeated question. I'm going to play around with what you gave me so far. Thank you!

+ 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. what does 6.9544E+23 stand for?
    By gokarterid in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-30-2012, 11:50 AM
  2. Let the gurus stand up please
    By abambam in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-20-2011, 12:54 PM
  3. Stand Alone program
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-18-2007, 10:47 AM
  4. What does the ! stand for in formulas?
    By ! in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-14-2005, 05:06 PM
  5. [SOLVED] Stand alone
    By Khalil Handal in forum Excel General
    Replies: 1
    Last Post: 03-08-2005, 07:06 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