View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] limpuiting@yahoo.com is offline
external usenet poster
 
Posts: 4
Default Find "X", bold entire row

I want to BOLD entire row where a cell contains text "X" in any cell
in
range(active sheet).

I had tried the below macro, it did bold the row contained text "X".
However everytime when I run this macro my excel program hang. Does
anyone has the solution?



Sub PutInBoldXs()
Dim r As Range
With Range("A1:C30")
Set r = .Find("X", LookIn:=xlValues, searchorder:=xlByRows)
If Not r Is Nothing Then
r.EntireRow.Font.bold = True

Do
Set r = .FindNext(r)
If Not r Is Nothing Then
r.EntireRow.Font.bold = True
End If
Loop

End If
End With
End Sub