Replicate Rule of Conditional Formatting

trowa
trowa used Ask the Experts™
on
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.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
John TsioumprisSoftware & Systems Engineer

Commented:
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

Author

Commented:
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.
Commented:
I think I solved it by simply select the cell then copy and paste to another cell, and it's working fine to replicate the rules. No VBA code was involved!

SnapShot.png

Author

Commented:
No longer need a macro solution.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial