Need help. If Column cells are blank highlight entire row.
Hey guys I have a mind nubbing project going on. I'm trying to create this macro for work.
What I am trying to do is create a macro that will look at an entire column....say for instance....Column D.
If Column D contains a blank cell then I need to highlight the entire row that cell is on ....
It's a comparison chart....Column C has an account status and on Column D I have a macro that will run a comparison again that column and return the results in cell D for each result.
What I need help on is how to highlight the rows where cell D is blank.
Any ideas on how to work this into a macro?
Thanks
http://img829.imageshack.us/img829/5963/exampleop.jpg
Re: Need help. If Column cells are blank highlight entire row.
try like
vb Code:
for each c in range("d:" & cells(rows.count, 4).end(xlup).row)
if isempty(c) then c.EntireRow.Interior.ColorIndex = 6
next
Re: Need help. If Column cells are blank highlight entire row.
Why dont you just use conditional formatting?
You could do it by selecting the entire area where your data is. Asuming A3 is the first cell in that range you select Home - Conditional Formatting - New Rule
Select: Use a formula to determine which cells to format
On the "Format values where this formula is true" field type:
=($D3="")
then select your format
That's it. it should highlight the whole row.