Marcster
01-13-2006, 04:17 AM
Hello people :hi: ,
I'm trying to write a macro which will find something a user inputs
into an Inputbox. Then highlights the entire row.
So far I have this:
Sub FindThenHighlightWholeRow()
'
' Prompts for input, finds it, then highlights whole row.
'
Dim toFind
toFind = Application.InputBox("What to search for:")
If toFind <> "" Then
Cells.Find(What:=toFind, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
ActiveCell.EntireRow.Activate
End If
End Sub
Although it highlights the found cell it doesn't highlight
the whole row.
I'm most likley missing something simple... :think:
Thanks :thumb,
Marcster.
I'm trying to write a macro which will find something a user inputs
into an Inputbox. Then highlights the entire row.
So far I have this:
Sub FindThenHighlightWholeRow()
'
' Prompts for input, finds it, then highlights whole row.
'
Dim toFind
toFind = Application.InputBox("What to search for:")
If toFind <> "" Then
Cells.Find(What:=toFind, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
ActiveCell.EntireRow.Activate
End If
End Sub
Although it highlights the found cell it doesn't highlight
the whole row.
I'm most likley missing something simple... :think:
Thanks :thumb,
Marcster.