Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Using conditional formatting, is there any way to turn Cell A1 red if a
conditional format has been applied to any cells in the range D1:H1? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Patrick,
Try using the following UDF as the CF condition for cell A1: '================ Public Function CFApplied(rng As Range) As Boolean Dim rCell As Range For Each rCell In rng.Cells If rCell.FormatConditions.Count Then CFApplied = True Exit For End If Next rCell End Function '<<================ The CF condition for A1 would then be: Formula Is: =CFApplied($D$1:$H1) --- Regards, Norman "Patrick Simonds" wrote in message ... Using conditional formatting, is there any way to turn Cell A1 red if a conditional format has been applied to any cells in the range D1:H1? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Norman, I believe that function will return TRUE even if the
conditional formating in D1:H1 is not applied. Nick Hebb BreezeTree Software http://www.breezetree.com |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Nick,
Norman, I believe that function will return TRUE even if the conditional formating in D1:H1 is not applied. Running: '=========== Sub Testit() Dim RngTest As Range Set RngTest = Range("D1, F1, H1") With RngTest .FormatConditions.Delete .FormatConditions.Add _ Type:=xlCellValue, _ Operator:=xlGreater, _ Formula1:="100" Debug.Print CFApplied(RngTest), "Some CF" .FormatConditions.Delete Debug.Print CFApplied(RngTest), "No CF" End With End Sub '=========== Returned: True Some CF False No CF for me. --- Regards, Norman "Nick Hebb" wrote in message oups.com... Norman, I believe that function will return TRUE even if the conditional formating in D1:H1 is not applied. Nick Hebb BreezeTree Software http://www.breezetree.com |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you mean -
a) The range has been applied with CF's and you want to know if any of the cells show the CF format because of a true condition, see Nick's suggestion. or b) You want to know if CF's have been applied to any cells in the range, regardless as to whether any conditions are true and one or more CF formats display, see Norman's suggestion. The latter is the correct literal interpretation of your question. But somehow I suspect you mean the former. (?) Regards, Peter T "Patrick Simonds" wrote in message ... Using conditional formatting, is there any way to turn Cell A1 red if a conditional format has been applied to any cells in the range D1:H1? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
conditional format question - I think... | Excel Worksheet Functions | |||
Another Conditional Format Question | New Users to Excel | |||
Conditional Format Question | New Users to Excel | |||
conditional format question | Excel Worksheet Functions | |||
Another Conditional format question | Excel Worksheet Functions |