Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find cells w/ same conitional formatting

Status
Not open for further replies.

N1GHTEYES

Technical User
Jun 18, 2004
771
GB
Does anyone know of a quick & easy method to determine whether two cells have the same conditional formatting?

The question arose from one a colleague asked me.

First I tried F5 special to see if that would help, but no joy.

Then I tried vba. if I directly compare the .FormatConditions property of each cell I seem to get a match if both cells have any conditional format - regardless of whether they are the same values for their settings.

I also considered going through all the sub-properties, but that started to seem very long-winded, especially as not all properties exist for some conditions, e.g. if the condition is ">7", say, the .Formula1 property = 7, but there is no .Formula2 property, wheras if the condition is 1<>9 then there is a .Formual2 property.

I even considered trying the idea of using VarPtr to get references to the memory allocated to each .FormatConditions object and using an API function to directly compare the memory allocated to each object, but I could not find a suitable API function - besides, I'm not sure it would work.

Any thoughts?

Tony
 
Ignore the above. It turns out it is in F5-specials, I just did not notice it.

0/10 for observation.

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top