Avatar of trowa
trowa
 asked on

Replicate Rule of Conditional Formatting

Is there any macro available to replicate a Rule of Conditional Formatting?

Let's say currently I got 3 rules in a selection/workbook, how can I replicate the first rule (green background with yellow font, or whatever) and become the 4th rule?

SnapShot.png
Or in another word, use macro to read the Conditional Formatting Rules, and create a new Rule? Any ideas?

Thank you.
VBAMicrosoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
trowa

8/22/2022 - Mon
John Tsioumpris

You can do this via VBA...here is a guide from Microsoft.
Side Note : I have found personally that the FormatCondition is a bit sensitive so add in your code
On Error Resume Next

Open in new window

I know its a bad practice but lets say that it will bypass many FormatCondition  hiccups
trowa

ASKER
Hi John,

Not too sure if that worked in Excel but in the article, it mentioned:

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

Thank you.
ASKER CERTIFIED SOLUTION
trowa

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
trowa

ASKER
No longer need a macro solution.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck