Adding Range for Search

  • Thread starter Thread starter Riz
  • Start date Start date
R

Riz

Hi,

I have created a search button in an excel spreadsheet.
When I click on the button normal "Find" window opens up.
However, it does not search the entire sheet. I have to
manually highlight the column to search. But if I open the
Find from Menu it searches the sheet without highlighting
anything.

Any suggestions.

Thanks,
Riz
 
Hi Riz

This might help.
I enter the word I want to find in cell B2 &
then click my search button.

Sub Find()
Range("B2").Select
Cells.Find(What:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:= False).Activate
Do
Cells.FindNext(After:=ActiveCell).Activate
ANSWER = MsgBox(" LOOK AGAIN ", vbQuestion + _
vbYesNo, "GOT IT?")
Loop While ANSWER = vbYes
End Sub

Mike Q
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top