Comparing Conditional Formatting in VBA

  • Thread starter Faraz A. Qureshi
  • Start date
F

Faraz A. Qureshi

How, can I compare the conditional format of one cell with other. For
instance, I want to create a UDF like

=SameCF(Cell1, Cell2)

so as to return a TRUE if both the cells have same conditional formatting
schemes applied, else FALSE.

Thanx in advance.
 
R

Rick Rothstein

Are you looking to see if they have the same "Conditions" (that is, what you
see in the Condition1, Condition2, Condition3 panels)? Or did you want to
know whether they had the same "Formats" (what you set after you press the
Format button for each condition), even if the triggering condition was
different? Either way, I think the function you want will probably be a much
longer than you are imagining.
 
F

Faraz A. Qureshi

I want to checkout and filter the cells not containinng the Conditional
Formatting as per the sample cell. In other words, I want to check ALL the
conditions.

--
Best Regards,

Faraz


Rick Rothstein said:
Are you looking to see if they have the same "Conditions" (that is, what you
see in the Condition1, Condition2, Condition3 panels)? Or did you want to
know whether they had the same "Formats" (what you set after you press the
Format button for each condition), even if the triggering condition was
different? Either way, I think the function you want will probably be a much
longer than you are imagining.
 
R

Rick Rothstein

I've been looking into this on and off for a couple of days now and think
the code to do what you want will be extensive. The problem appears to be
that there is no fully defined Conditional Format object as such... that is,
you can't just test if one CF object is equal to another like you can do
with other objects... it appears you have to test each part separately....
and there are a **lot** of parts. For example, you can't just test the Font
format as an object... you have to test each possible Font property (Bold,
Italic, Size, Color, etc.) individually... and that is just one small part
of the testing... after that, there is the Borders, Line Styles, and so on.
And you have to do this for each Condition!

--
Rick (MVP - Excel)


Faraz A. Qureshi said:
I want to checkout and filter the cells not containinng the Conditional
Formatting as per the sample cell. In other words, I want to check ALL the
conditions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top