Results 1 to 12 of 12

Validating cells based on content and background color

Threaded View

anthronewman Validating cells based on... 08-04-2015, 02:25 PM
GeneralDisarray Re: Validating cells based on... 08-04-2015, 02:40 PM
anthronewman Re: Validating cells based on... 08-04-2015, 04:51 PM
nigelbloomy Re: Validating cells based on... 08-04-2015, 02:48 PM
anthronewman Re: Validating cells based on... 08-04-2015, 04:52 PM
nigelbloomy Re: Validating cells based on... 08-04-2015, 05:34 PM
anthronewman Re: Validating cells based on... 08-04-2015, 06:53 PM
anthronewman Re: Validating cells based on... 08-04-2015, 08:00 PM
GeneralDisarray Re: Validating cells based on... 08-05-2015, 08:23 AM
anthronewman Re: Validating cells based on... 08-05-2015, 11:40 AM
nigelbloomy Re: Validating cells based on... 08-05-2015, 01:13 PM
GeneralDisarray Re: Validating cells based on... 08-05-2015, 01:16 PM
  1. #6
    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

    What about my code didn't work? I tested it on the attached file and it seems to work.

    Sorry. There was one line that only worked because of the way my sheet was set up. This should be better:
    Sub test()
    Dim rng As Range
    Dim lRow As Long
    lRow = Sheets("Sheet1").UsedRange.Rows.Count
    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
    Attached Files Attached Files
    Last edited by nigelbloomy; 08-04-2015 at 05:38 PM.

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