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

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,214,920
Messages
6,122,264
Members
449,075
Latest member
staticfluids

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