+ Reply to Thread
Results 1 to 10 of 10

Conditional Formating Error Message

  1. #1
    Registered User
    Join Date
    04-07-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    5

    Conditional Formating Error Message

    I have drop-down list in H4 (A, B, C, D, E). I want an error message when H4 has C, D, or E and I4 is empty (do not contain an email address). Many Thanks I am stuck on this for a long time. !!

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Formating Error Message

    Since you are already using Data Validation to create the dropdown list (I assume), you can use conditional formatting to change the background color to red (for example) when that condition is met. Otherwise, I think you'll need to resort to VBA.
    =AND(OR(H4="C", H4="D", H4="E"), LEN($I4)<1)
    Would that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    04-07-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Conditional Formating Error Message

    Quote Originally Posted by ChemistB View Post
    Since you are already using Data Validation to create the dropdown list (I assume), you can use conditional formatting to change the background color to red (for example) when that condition is met. Otherwise, I think you'll need to resort to VBA.
    =AND(OR(H4="C", H4="D", H4="E"), LEN($I4)<1)
    Would that work for you?

    Thank you for your reply. I would prefer to give an error message. So there is no way I can have an error message and stop the user from proceeding ahead without entering email in I4? Conditional formating only fills the cell in red.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Formating Error Message

    I believe you'll need to use an event driven VBA. Is that okay with you?

  5. #5
    Registered User
    Join Date
    04-07-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Conditional Formating Error Message

    Sorry I have no experience with VBA. How long will it take to learn this? I have to send across this template to other departments to fill and send back !

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Formating Error Message

    I can write the VBA. are we just talking about H4 or is it H4:H100?

  7. #7
    Registered User
    Join Date
    04-07-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Conditional Formating Error Message

    Thank you very much. Actually it is N4 to N166 and I want the error message "Please enter email address" for not filling corresponding cell in column O. And the same relationship applies for P & Q, R & S, T & U, V & W, X & Y, Z & AA, AB & AC, AD & AE. Thank you, you are a life saver.

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Formating Error Message

    Okay, try this.
    Right click on the sheet tab where all this is happening. Then "View code"
    Paste this code into the window that opens up (VBA Editor) text box on the right of screen
    Please Login or Register  to view this content.
    See if it works
    Last edited by ChemistB; 04-07-2014 at 04:11 PM.

  9. #9
    Registered User
    Join Date
    04-07-2014
    Location
    Germany
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Conditional Formating Error Message

    Works great ChemistB. Thank you million times. Cheers

  10. #10
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Conditional Formating Error Message

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. Replies: 5
    Last Post: 03-14-2014, 04:03 AM
  2. Replies: 4
    Last Post: 01-23-2014, 10:14 AM
  3. Conditional Formating to flag % Error
    By Grandinett in forum Excel General
    Replies: 5
    Last Post: 06-05-2012, 12:52 PM
  4. Replies: 6
    Last Post: 08-14-2006, 05:00 PM
  5. Replies: 2
    Last Post: 03-27-2006, 12:10 PM

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