Excel: Highlight blank cells


Hi excel gurus, I have the following code which does not work properly, it should highlight cells in one column that are blank:


Sub BorderForNonEmpty()
    Dim myRange As Range
    Set myRange = Sheets("Inventory").Range("A1:A888")
'clear all color
    myRange.Interior.ColorIndex = xlNone
'color only blank cells
    myRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 6
End Sub
Please can someone help :)??


This question generated 17 answers. To proceed to the answers, click here.

This thread is current as of October 07, 2014.


For more resources for Microsoft Excel