View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Excel VBA Evaluation of FormatConditions(1).Formula1

Oops, I adjusted the range to test

Dim cell As Range
Dim sF1 As String

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

If cell.FormatConditions.Count 0 Then

're-adjust the formula back to the formula that applies
'to the cell as relative formulae adjust to the activecell
With Application
sF1 = .Substitute(cell.FormatConditions(1).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 = True"
End If
End If
Next cell


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



wrote in message
...
1. Enters an Excel Code Module :-

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

If cell.FormatConditions.Count 0 Then

cell.Activate 'How could this statement be eliminated ?

If Evaluate(cell.FormatConditions(1).Formula1) Then
MsgBox "FormatConditions = True"
End If
End If
Next cell

2. Would like to maintain the functionality of the above code after
removing the statement, "cell.Activate".
And so, that means that certain other replacement code must be
emplaced thereof.

3. The primary objection to "cell.Activate" is that it causes screen-
blinking and it's still blink-blink-blink of the screen despite that,

Application.ScreenUpdating = False :cell.Activate

is emplaced thereof.

4. Please share your experience. Regards.