+ Reply to Thread
Results 1 to 3 of 3

Display msgbox once if any cell in range is a specific color

  1. #1
    Registered User
    Join Date
    04-24-2015
    Location
    Seattle, WA
    MS-Off Ver
    2013
    Posts
    12

    Display msgbox once if any cell in range is a specific color

    Hi All,

    I am trying working on a spreadsheet that has users enter data into cells that are color coded. For example, if a cell has a yellow background, it needs to be populated. If it's not populated, the background color needs to be changed to a red and a msgbox needs to pop up and tell them "hey, you didn't fill out all required fields!"

    I feel like I have the code figured out to define the range of the cells that need to be validated (with the help of taking examples I've found online and tweaking them). I also feel like I've figured out how to change the background colors of empty yellow cells to red. I'm just stuck on how to have the range searched for any red background cells and create a msgbox ONCE to let the user know there is a field or more than one field that needs to be filled out). A few weeks ago, I had figured out a way to have it display a message box for EVERY cell, but that is totally cumbersome if there are 100 cells with a red background. Here's the code I'm working with so far:

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Display msgbox once if any cell in range is a specific color

    Looks close, a few tips for you to try and fix it yourself, although I will do it for you if you're having problems.

    Declare a Boolean variable and set it to true when you change a cell to red.

    Remove the 'exit for' line.

    Display message box if the Boolean variable is true. This needs to be after 'next cell' or you will get it more than once.

  3. #3
    Registered User
    Join Date
    04-24-2015
    Location
    Seattle, WA
    MS-Off Ver
    2013
    Posts
    12

    Re: Display msgbox once if any cell in range is a specific color

    Thanks, Jason! That did the trick. A good way to end a Friday

+ 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. Specific number of cell to fill with color based in a dynamic cell range
    By Blue_Wings in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-01-2015, 09:46 AM
  2. Specific number of cell to fill with color based in a dynamic cell range
    By Blue_Wings in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-28-2015, 10:10 AM
  3. If > 7 cells are true in a range then display msgbox
    By Templemind in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-22-2014, 09:02 AM
  4. Display msgbox if two cells in range are not empty
    By loroverde in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2014, 12:49 AM
  5. [SOLVED] Display Range of Values with MsgBox
    By akynyemi in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-17-2013, 03:40 AM
  6. [SOLVED] MsgBox when a cell within a range changes to a specific value
    By kitackers in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-20-2012, 08:49 AM
  7. Display msgbox when specific text entered in specific range
    By Ali_Riza in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-20-2012, 08:05 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