Searching in an excel spreadsheet

Joined
Jun 25, 2009
Messages
7
Reaction score
0
I need to find a better way to search for text in a spreadsheet (besides Ctrl-F). I tried the following, but I don't like it, because it highlights the area it is searching. Please let me know if you have any better solutions.
Sub searchsheet()
Dim searchthis As String
'Opens box and ask what do they want to search
searchthis = InputBox("Type in a keyword.", "Search")
'Tells where to search
Columns("A:I").Select
'and then search in them whatever the user entered:
Selection.Find(What:=searchthis, After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
'if found go to first found
'if not found show message box saying it cannot be found


End Sub

Thanks :user:
 

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

Top