Prevent Conditional Formatting Replication / Create Dynamic CF

Jeffrey Mahoney

Well-known Member
Joined
May 31, 2015
Messages
2,827
Office Version
  1. 365
Platform
  1. Windows
When a user copies cells that have Conditional Formatting (CF), sometimes a new CF rule gets added with the same formatting as the previous rule. Let's say I have CF on a wide area A3:T400. I copy a row and paste below. I now have a new rule that covers only the new pasted row along with the original CF for the entire area.

Is there any way to prevent CF replication?

Is there any way to make the CF range dynamic?
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Not that someone smarter than me won't come along and tell us how to do that; but I've never found a way to prevent it. When there is a lot of copy/paste happening, CFs have a way of multiplying. But it can be cleaned up. My solution is to have a VBA routine that can be run to clean up the duplicates and/or extend the range if new rows have been added, but there are other ways. Google "Fix duplicated Conditional Formatting Rules" and you'll get a lot of hits.
 
Upvote 0
Yup, I've had to write code to "HEAL" the CF. The problem that I've noticed is that I have to apply ALL the conditional formatting for a sheet to fix one of the CF rules. Meaning I have to code for all the potential rules. If I change one CF rule, then my code is outdated. It works fine if I only have one rule.
 
Upvote 0

Forum statistics

Threads
1,215,767
Messages
6,126,766
Members
449,336
Latest member
p17tootie

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