|
-
Nov 21st, 2011, 12:45 PM
#1
Thread Starter
Hyperactive Member
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
Last edited by simpleonline1234; Nov 21st, 2011 at 01:01 PM.
Are you down with OOP?
-
Nov 21st, 2011, 03:37 PM
#2
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
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Nov 21st, 2011, 04:28 PM
#3
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.
More important than the will to succeed, is the will to prepare for success.
Please rate the posts, your comments are the fuel to keep helping people
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|