View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Chip Pearson
 
Posts: n/a
Default Macro for Finding account numbers

Try something like the following:

Dim FindWhat As String
Dim FoundCell As Range
FindWhat = InputBox("Find What", "Find")
If StrPtr(FindWhat) = 0 Then
Exit Sub
End If
On Error Resume Next
Set FoundCell = Range("A1:A100").Find(what:=FindWhat, _
lookat:=xlWhole, LookIn:=xlValues)
If FoundCell Is Nothing Then
MsgBox "Not Found"
Else
MsgBox "Found at: " & FoundCell.Address
End If



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"JL" wrote in message
...
I am a beginner at writing macros so I am asking for assistance.
What I
would like to do is have a macro that pulls from a cell or
input box an
account number the user is wanting to see and locates on that
same worksheet.
Basically identical to the Find function but with a macro for
the input.
Thanks in advance for any assistance.