View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
[email protected] tkt_tang@hotmail.com is offline
external usenet poster
 
Posts: 92
Default Excel VBA Evaluation of FormatConditions(1).Formula1

Mr. Bob Phillips,

Thank you for clarification of my query.

1. It appears that should FC.Formula1contain a Named Formula, the
following code would not accomodate the situation.

For Each cell In ActiveSheet.Range("B6:N145")

For i = 1 To cell.FormatConditions.Count

Set FC = cell.FormatConditions(i)

With Application
sF1 = .Substitute(FC.Formula1, "ROW()", cell.Row)
sF1 = .Substitute(sF1, "COLUMN()", cell.Column)
sF1 = .ConvertFormula(sF1, xlA1, xlR1C1)
sF1 = .ConvertFormula(sF1, xlR1C1, xlA1, , cell)
End With

If Evaluate(sF1) Then

MsgBox cell.Address & " - FormatConditions(" & i & ") =
True"
End If
Next i
Next cell

2. Please share your experience. Regards.