View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Ryan H Ryan H is offline
external usenet poster
 
Posts: 489
Default Macro to highlight a specified row

I wasn't sure what you meant by "highlight". Did you want to select it or
color it yellow? So I did both in the code below. Hope this helps! If so,
click "YES" below.

Sub HighlightRow()

Dim MyRow As Long

MyRow = Range("B:B").Find(What:="Gauranteed", _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False).Row

' select the row
Rows(MyRow).Select

' highlight row yellow
Rows(MyRow).Interior.Color = 65535

End Sub
--
Cheers,
Ryan


"Jodie" wrote:

How would I write a macro to find "Gauranteed" in any cell in Column "B" and
then highlight that row? Also, this would be for an entire workbook.
--
Thank you, Jodie