Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
JL
 
Posts: n/a
Default Macro for Finding account numbers

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.
  #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.



  #3   Report Post  
Posted to microsoft.public.excel.misc
tcowen
 
Posts: n/a
Default Macro for Finding account numbers


Another option besides a macro is to have named ranges. Read up on
those and see if it would solve your problem. Then all they have to do
is use the F5 key for "go to" and pick the name range they want. There
are ways to build named ranges from lists so it is somewhat simple.
Another method is to have a list and create hyperlinks. You can also
create drop down lists. Macros can be as easy or as complicated as you
need, but some end users get "freaked" when they see the "Enable macros"
choice when a file opens. A simple macro would be to designate an input
cell (they would enter the account in this cell) and then your macro
would do a find in a designated area and go-to that cell. Sounds like
you need to have a list first though. Turn on the macro recorder and
start with something simple. If it works, expand it to your specific
situation. That's how I taught myself.

TcO


--
tcowen
------------------------------------------------------------------------
tcowen's Profile: http://www.excelforum.com/member.php...fo&userid=6921
View this thread: http://www.excelforum.com/showthread...hreadid=494691

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Copy cell format to cell on another worksht and update automatical kevinm Excel Worksheet Functions 21 May 19th 05 11:07 AM
Checking Winning Numbers in the Lottery. Ann Excel Discussion (Misc queries) 4 May 18th 05 10:55 AM
How do I delete 100 account numbers from a spreadsheet colume wer. Ndubuisi Azuogu Excel Worksheet Functions 2 November 11th 04 04:11 PM
How do I setup a list box that has several account numbers so use. Jackie Excel Worksheet Functions 1 November 8th 04 07:03 PM


All times are GMT +1. The time now is 08:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"