Macros with conditional formatting in Excel 2010

sm2200

Board Regular
Joined
Feb 25, 2002
Messages
90
I am using Excel 2010. I would like to use recorded macros to apply conditional formatting to certain columns.

For example, say I record a macro to conditionally format columns A through C where any value less than 0 is red, and greater than or equal to 0 is green. Then I record a second macro to conditionally format columns D through F where any value less than 20 is red, and greater than or equal to 20 is green.

The problem I face is that whenever I run the second macro, it wipes out the conditional formatting that the first macro applied to columns A through C.

I also tried recording this all as one macro, and it still didn't work.

Any conditional formatting commands run in macros seem to override previous conditional formatting, even though the columns selected are completely different. How can I prevent this from happening?
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Forum statistics

Threads
1,214,911
Messages
6,122,196
Members
449,072
Latest member
DW Draft

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