FormatConditions -- Conditional Formatting -- macros
(continuation of Conditional Formatting web page.
The following are some examples found searching for "FormatConditions".
There were some examples that seemed to set up C.F. for no reason,
because they set up C.F. for selection areas and don't change. But I
realize now the purpose could be to override regular formatting, and
then if you remove the C.F. you revert back to regular formatting.
- Conditional Formatting , modified Bernie Deitrick's function, (formula.htm#condformula)
Function CondFormula(myCell, Optional cond As Long = 1, _
Optional cond2 as Long = 1) As String
'Bernie Deitrick programming 2000-02-18, modified D.McR 2001-08-07, 2002-02-07, 2004-06-13
CondFormula = ""
On Error Resume Next
if cond2 = 2 then 'second formula if rannge type C.F.
CondFormula = myCell.FormatConditions(cond).Formula2
else 'preferred if only one formula
CondFormula = myCell.FormatConditions(cond).Formula1
=CondFormula(D14, 1) -- for the 1st of 3 possible conditions
=CondFormula(D14, 2) -- for the 2nd of 3 possible conditions
- FormatConditions 2002-12-05, Dave Peterson, misc
Conditional Formatting Colors,
Chip Pearson, concerning formulas in macros, and for normal Worksheet usage Conditional Formatting
Excel Oddities: The Elusive Formula1 Property for Conditional Formatting, John Walkenbach
- Setting up C.F. in a macro for 3 conditions (Small 1 thru 3), Tom Ogilvy, 2000-03-09
- Counting the C.F. that are true, John Green, 2000-09-01
- Setting up C.F. on null value for a selection, Tom Ogilvy, 2000-06-01
- Setting up C.F. to focus on "WA" in a zip state column, Jim, 1999-08-01
Please send your comments concerning this web page to: David McRitchie
send email comments
Copyright © 1997 - 2004, F. David McRitchie, All Rights Reserved