VBA to conditionally format a range

asad

Well-known Member
Joined
Sep 9, 2008
Messages
1,434
Hi All again,

I have the following code which I thought will do the job for me. Unfortunately not.
Code:
Sub Int_Col()

With Range("D15:Q101")
If Range(cell.Row, "A") = "" And Range(cell.Row, "C") = "" Then
Range("D15:Q101").Interior.Color = 192
Else: Range("D15:Q101").Interior.Color = xlNone
End If
End With


End Sub
All I am trying to achieve is to highlight only rows that have cells in columns A and C blank (there may be formulas in those that result in blank).

Any help is much appreciated.
Thanks
Asad
 
I guess if it works for you. If you want to provide a dropbox (or something like it) link to your file, I can look at it further.
 
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top