Printing conditional formatting

  • Thread starter Thread starter Mike Harris
  • Start date Start date
If you mean to print a list of what cells have conditional formatting and what the conditions
are, I believe you'd have to do this with a VBA routine that uses the FormatConditions property
of the Range object. VBA Help says this:

~~~~~~~~~~~~~~~~~~~~~~~
FormatConditions Property
Returns a FormatConditions collection that represents all the conditional formats for the
specified range. Read-only.

Example
This example modifies an existing conditional format for cells E1:E10.

Worksheets(1).Range("e1:e10").FormatConditions(1) _
.Modify xlCellValue, xlLess, "=$a$1"
~~~~~~~~~~~~~~~~~~~~~~~

That's a bit schizoid: the 3rd line says it's a read-only property. Then the example proceeds to
show you how to change it.

I can see this getting very cumbersome when you have, say 100 cells with essentially the same 3
conditions. Would you print the same "stuff" 100 times? If not, how would you sift through the
cells to find those with common conditions.
 
I would suggest just using a User Defined Function to show some representative
cells to show a conditional formatting.


Conditional Formatting (#condformula)
http://www.mvps.org/dmcritchie/excel/formula.htm#condformula

Conditional Formatting is considerably harder to show what you want to see.
It has a range that you can't just see, anyway the following is a start and will work
best if it just has a formula, rather than "is less than" type of conditions.

Function CondFormula(myCell, Optional cond As Long = 1) As String
'Bernie Deitrick programming 2000-02-18, modified D.McR 2001-08-07
Application.Volatile
CondFormula = myCell.FormatConditions(cond).Formula1
End Function
 
Back
Top