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

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,215,065
Messages
6,122,944
Members
449,095
Latest member
nmaske

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