View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default Find First Cell With a Font ColorIndex =3


hi
add this if you don't want the second occurance.
Sub testfollowup()
Dim c As Range
For Each c In ActiveSheet.Range("K12:AI10000")
If c.Font.ColorIndex = 3 Then
MsgBox "Please make additional corrections"
exit sub'*******************
End If
Next c
End Sub

regards
FSt1

"Ron" wrote:

On Jul 2, 2:32 pm, "Rick Rothstein"
wrote:
How did the font become red... by using conditional formatting or by
directly setting it?

--
Rick (MVP - Excel)

"Ron" wrote in message

...



Hi all,


I'm trying to find the first cell with a font ColorIndex that equals 3
(Red). Then a MsgBox with a comment. This is where I'm at and I
don't think my code is finding the cell with red fonts.


Sub testfollowup()


Dim c As Range


For Each c In ActiveSheet.Range("K12:AI10000")
If ColorIndex = 3 Then


MsgBox "Please make additional corrections"


End If


Next c


End Sub


Thank you all for any assistance,- Hide quoted text -


- Show quoted text -


Hello, font was set to red to flag an error. The code provided by
Fst1 works however, if I have more than one occurance of the red font
clicking OK or Cancel does not dismiss the msgbox and I have to kill
Excel to get out of the message box. Any suggestions? Greatly
appreciated. Thanks, Ron