Identify specific formatting conditions with VBA

Greemo

New Member
Joined
May 22, 2014
Messages
42
Hello,

In my spreadsheet I have a variation of conditional formatting rules applied (that often overlap each other) to specific cells. Sometimes I have an icon set applied on top of another conditional formatting rule that simply turns the font color red if the value is greater than my specified value. How do I have a sub to detect whenvthere is an icon set, to delete that icon set rule and keep any other additional conditional formatting rules I may already have applied?

I currently have this which deletes all of the conditional formatting rule instead of just the icon set conditional formatting rule:

Code:
If Selection.FormatConditions.Count > 0 Then
Selection.FormatConditions.Delete
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Bump -

To clarify: I'm looking to delete only specific formatting conditions while still preserving any other formatting conditions that may be applied. E.g. I want to check if there is an existing icon set conditional formatting rule, if so then to delete this specific rule only and no others.

Any help would be appreciated.

Thank you,

Greemo
 
Upvote 0
Sounds like the easiest way would be to change the conditions on the one that you sometimes will delete. I would probably make it something like this

=AND( originalCondition, Not( cancellingCondition ))
 
Upvote 0

Forum statistics

Threads
1,215,425
Messages
6,124,824
Members
449,190
Latest member
rscraig11

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