BENSON
09-17-2009, 05:31 AM
I found the code below in this forum, I would like to amend it that it will also show as well as the cell address that meets the test the stock item in colum "A" ie if cell "C3" is conditional formated red it would return the value of "A3" as well as the cell address
Thanks
[VCode]
Sub CF()
Dim cel As Range
Dim rng As Range
Dim myOp As Long
Dim myCell As Range
Dim myColour As Long, msg
Set rng = Sheets("24HR Summary").Range("A4:AJ12")
For Each cel In rng
On Error Resume Next
If cel.FormatConditions.Count > 0 Then
If cel.Value > cel.FormatConditions(1).Formula1 Then
msg = msg & vbNewLine & cel.Address
End If
End If
myColour = 0
myOp = 0
Next cel
MsgBox msg
Set cel = Nothing
Set rng = Nothing
Set myCell = Nothing
End Sub
[/Code]
Thanks
[VCode]
Sub CF()
Dim cel As Range
Dim rng As Range
Dim myOp As Long
Dim myCell As Range
Dim myColour As Long, msg
Set rng = Sheets("24HR Summary").Range("A4:AJ12")
For Each cel In rng
On Error Resume Next
If cel.FormatConditions.Count > 0 Then
If cel.Value > cel.FormatConditions(1).Formula1 Then
msg = msg & vbNewLine & cel.Address
End If
End If
myColour = 0
myOp = 0
Next cel
MsgBox msg
Set cel = Nothing
Set rng = Nothing
Set myCell = Nothing
End Sub
[/Code]