I'm a newbie and need help searching

Joined
Jun 25, 2009
Messages
7
Reaction score
0
I'm just a teen beginning to learn VBA code etc. My only experience w/ code is my graphing calculator. I've been searching all over this website and cannot find any better ways to search in an excel spreadsheet than the following:

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

Please help
 

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