Results 1 to 6 of 6

code not working to highlight a cell if blank

Threaded View

  1. #1
    Registered User
    Join Date
    08-11-2009
    Location
    Gilbert, Arizona, USA
    MS-Off Ver
    Excel 2003
    Posts
    82

    code not working to highlight a cell if blank

    I have a bit of code that should find a blank cell within a column and paint that cell as a color 6 (color of a yellow highlighter).

       Dim blank As range, LR1 As Long, z As Long
            For Each blank In range("AG2", range("AG" & Rows.Count).End(xlUp))
            If UCase(blank.Value) = "" Then
               range(Cells(blank.Value)).Interior.ColorIndex = 6
              End If
            Next blank
        LR1 = Cells(Rows.Count, "AG").End(xlUp).Row
        For z = LR1 To 2 Step -1
    Basically, if any cell within the column "AG" has been left blank, I need just that cell highlighted. I am a beginner and came up with this code by piecing together other code that has worked for me. I think the "UCase" is wrong but I don't know what to put in its place. Is that all?
    Thanks.
    Last edited by curbster; 09-08-2009 at 04:53 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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