+ Reply to Thread
Results 1 to 8 of 8

Highlighting blank cells

  1. #1
    Registered User
    Join Date
    10-08-2013
    Location
    Eugene, OR
    MS-Off Ver
    Excel 2010
    Posts
    43

    Highlighting blank cells

    I am new to VBA and cannot seem to get the code right to do the following:
    Range is C2 to end of column, including blanks
    Find the blanks
    For each blank cell,
    .Interior.Color = 10066431
    .Borders(xlLeft) = -16777024
    .Borders(xlTop) = -16777024
    .Borders(xlBottom) = -16777024
    .Borders(xlRight) = -16777024
    Finally, I want to return a message to the user the cell addresses that are blank.
    "The following cells are blank: C4 (or $C$4), C8, C100, C120, etc.)

    Can someone provide some guidance? My code seems to move all the blank cells to the bottom, and I'm not sure how it's even doing that.
    Thanks!

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Highlighting blank cells

    Try this:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-11-2013
    Location
    leeds
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Highlighting blank cells

    Better answer above!
    Last edited by notreallyIT; 12-05-2013 at 03:15 PM. Reason: noob

  4. #4
    Registered User
    Join Date
    10-08-2013
    Location
    Eugene, OR
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Highlighting blank cells

    I copied that into mine, but it stops on
    For Each rCell in Range("C2:C" & Range ("C" & Rows.Count).End(xlUp).Row).SpecialCells(xlCellTypeBlanks)
    I get "Unable to get the SpecialCells property of the Range class" - see attached

    12-5-2013 11-25-13 AM.jpg

  5. #5
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Highlighting blank cells

    It would only do that if there are no blank cells in range C2:C and the last used row. Is there only 1 worksheet (ie is it referencing the correct sheet). Are you sure its column C.

    There could be many things causing this. I would recommend submitting a copy of your workbook as the code worked just fine on a test workbook.

  6. #6
    Registered User
    Join Date
    10-08-2013
    Location
    Eugene, OR
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Highlighting blank cells

    Here is my sample worksheet.
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Highlighting blank cells

    It worked just fine for me on your sample spreadsheet. Here is another way of doing the same thing which may bypass whatever problem you are having:

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    10-08-2013
    Location
    Eugene, OR
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Highlighting blank cells

    OK I got it run successfully and it highlights all the blank cells, except for C2 and C3. For some reason, it doesn't see C2 and C3 as blank cells. If I clear contents on those two cells and rerun the code, it works perfectly.

+ 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. [SOLVED] Complaints Sheet - Highlighting row if blank cell is blank for two days
    By northern88 in forum Excel General
    Replies: 4
    Last Post: 11-01-2012, 07:41 PM
  2. [SOLVED] Conditional format formula for highlighting a column that is blank
    By Trinity29_09 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-16-2012, 09:00 PM
  3. Highlighting a Cell, based on value / blank.
    By robert_shindorf in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-29-2008, 07:42 PM
  4. Blank Cells - Highlighting them
    By JennyW in forum Excel General
    Replies: 2
    Last Post: 10-09-2006, 09:36 AM
  5. Replies: 6
    Last Post: 08-28-2005, 05:05 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