+ Reply to Thread
Results 1 to 12 of 12

Validating cells based on content and background color

Hybrid View

  1. #1
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: Validating cells based on content and background color

    Does this do what you are looking for?
    Sub test()
    Dim rng As Range
    Dim lRow As Long
    lRow = Sheets("Sheet1").UsedRange.Row
    Set rng = Sheets("Sheet1").Range("A" & lRow & ":DD" & lRow)
    
    With rng
        For Each cell In rng
            If cell.Interior.ColorIndex = 6 Then
                If cell.Value = Empty Then
                    MsgBox "Please ensure that you have filled      " & Chr(10) & "out all empty yellow fields'.", vbOKOnly + vbInformation, "Please fill empty fields"
                    Exit Sub
                End If
            End If
        Next cell
    End With
    End Sub
    Some people volunteer in soup kitchens or hospitals. I choose to make the world better by trying to help you with Excel. We're all learning.

    <---Click * Add Reputation for all helpful comments. It's like giving a smile.
    Forum Rules: How to mark your post [Solved] and have a happier, Excel enriched life.

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

    Re: Validating cells based on content and background color

    Hi Nigelbloomy,

    Unfortunately this did not work. Thanks for the suggestion, though!

+ 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. How to add cells just based on their color background?
    By meirelesj in forum Excel General
    Replies: 7
    Last Post: 07-28-2015, 07:04 AM
  2. Modify Cell Background Color based on cell content
    By CWDurkin in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-01-2014, 11:57 AM
  3. Change cell background color based on another cells background color
    By Queo in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 4
    Last Post: 06-10-2014, 05:28 AM
  4. [SOLVED] Sum and average cells based on background color
    By Kaitlynn in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-22-2013, 12:51 PM
  5. [SOLVED] Color Index to sum up cells based on background color
    By jph89 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-16-2013, 03:23 PM
  6. Replies: 3
    Last Post: 05-02-2012, 09:08 AM
  7. Count Cells Based On A Background Color
    By NSTurk725 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-27-2010, 11:29 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