Conditional formatting based on other cell for entire column

kpierce

Board Regular
Joined
Jun 21, 2010
Messages
76
Hello -
I am wanting to format (colr fill with Blue), columns A,B,C if cell D is equal to "Your Company"

I have researched and have it work when I select:

Select $A$1:$C$1
Conditional Formatting-Use Formula to determine which fields to format
Then enter in the formula:
= $D$1 = "Your Company"

However, I want to apply this rule to the entire column, because I have a macro that comes in and deletes all the rows before starting so this also takes the conditional formatting with it.

I am trying to get something like the following to work, but am have very little luck.
Highlight columns A,B,C
So I get
Applies to =$A:$C
Formula =$D:$D = "Your Company"

But this does not work.

If I do the following it works:
Applies to =$A:$C
Formula =$D$1 = "Your Company"

But if I then delete row 1 in my macro I loose the conditional formatting.

Is there a way around this?

as always, thanks in advance.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Why does the macro delete rows, or clear rows? You should just remove the contents of the row(s) by using .ClearContents instead of .Delete.
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,671
Members
452,937
Latest member
Bhg1984

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