View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nick Hebb Nick Hebb is offline
external usenet poster
 
Posts: 162
Default Conditional format question

You could create a user defined function that checks the range for the
same conditions as the conditional formatting in range D1:H1 checks
for. As a simple example, if the conditional formatting for D1:H1 is
applied for values 5, the user defined function might look like:

Public Function myUDF(ByRef TargetRange As Range) As Boolean

Dim r As Range
For Each r In TargetRange.Cells
If r.Value 5 Then
myUDF = True
Exit Function
End If
Next
myUDF = False

End Function


Then in A1's conditional formatting, select "Formula is" from the
dropdown and enter =myUDF(D1:H1) and select the formatting for a TRUE
condition.

Would this work for you?

Nick Hebb
BreezeTree Software
http://www.breezetree.com