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?
 

Some videos you may like

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Watch MrExcel Video

Forum statistics

Threads
1,127,247
Messages
5,623,603
Members
415,981
Latest member
Baltwin

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
Top