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.
0
JL (36)
12/19/2005 8:27:02 PM
excel.misc 78881 articles. 5 followers. Follow

2 Replies
349 Views

Similar Articles

[PageSpeed] 31

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" <JL@discussions.microsoft.com> wrote in message 
news:9D0CAFEF-545D-432D-92C1-8F844306F9B2@microsoft.com...
>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. 


0
chip1 (1821)
12/19/2005 8:58:02 PM
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?action=getinfo&userid=6921
View this thread: http://www.excelforum.com/showthread.php?threadid=494691

0
12/19/2005 9:00:38 PM
Reply:

Similar Artilces:

Chart to represent sale number by individual contrubtion vs total
I need help on how to create a chart to represent sales number by individual contributor vs total. E.g. Alvin = $50 Mary = $150 John = $80 Kate = $120 Total = $400 The chart should show a graphical representation of $400 as the total, and it shows how each person contribute to the chart. Hi, One way would be to plot the data, not including the total as a stacked column. Alternately, you could plot the data without the total as a column chart and then plot the total as a line on the same chart. Just make a second series with each item the total. -- If this helps, please click th...

Need better way to provision AD accounts that are to have mailboxes
The exchange admins in my company have come up with a way for the sys admins to assign the user's mailbox store location. It's based off of last name. For example, if your last name starts with letter A, you go on Storage Group 1, Mailbox Store A, if your last name starts with letter B, you go on Storage Group 1, Mailbox Store B, if your last name starts with letter E, you go on Storage Group 2, Mailbox Store A, etc.... This is, I believe, and administrative nightmare. Is there a better way to provision AD accounts that are to have mailboxes? If it works for you and them, then al...

Macro warning with no macros
I have a workbook that when I try to open it I get the warning tellin me it contains macros and asking whether I want to Enable or Disabl them. I put no macros, no VB scripts, nothing at all in the workboo other than standard Excel formulas and some charts. I developed it i Excel 2002, SP-2, but have moved it back and forth between tw computers, the other which has Excel 97. Regardless of whether Enable or Disable or change the security settings so as not to get th warning, once the workbook is open even if I go t Tools-Macro-Macros... it lists no macros. How can I find out what's cau...

counting numbers if certain criteria are met?
I have two columns. the first has single digits between 0 and 9, th second has x's with blank spaces in between. Anyone know how to count or mark all the 2's in the first column that also have an x in th second column? Don't want to just count ALL the 2's -- Message posted from http://www.ExcelForum.com Hi Try something like this: =SUMPRODUCT((A2:A1000=2)*(B2:B1000="x")) -- Andy. "judoist >" <<judoist.17uhhk@excelforum-nospam.com> wrote in message news:judoist.17uhhk@excelforum-nospam.com... > I have two columns. the first has single ...

Where do I find "save as..." in MS Office 2007 ?
Sorry, but I did not found "save as..." menu in Office 2007. I only found in the upper left corner a flopy icon which represent a "save" but not a "save as...." So where is "save as..." (with files selction dialog) hidden in Office 2007? Camille Click the Office button (the round "pizza icon" in the upper left corner of the screen) and then click Save As. -- Stefan Blom Microsoft Word MVP "Camille Petersen" <cpet_magnus@hotmail.com> wrote in message news:4baf94cc$0$6768$9b4e6d93@newsspool3.arcor-onlin...

Macro
Can anybody tell me how to kick off a macro automatically as file is opened? Regards ...

Macro
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: intel Hi, I'm thinking of buying Mac: Office 2008, but before I do I want to check that I will be able to download Scritpsmart collection of templates without any glitches: <http://www.bbc.co.uk/writersroom/scriptsmart/faq.shtml> Does anyone know if I can do this? Regards, SP. In article <ee98ff5.-1@webcrossing.caR9absDaxw>, StregaItalia@officeformac.com wrote: > Version: 2008 > Operating System: Mac OS X 10.4 (Tiger) > Processor: intel > > Hi, > > I'm thinking of buying Mac: Of...

Compile Error: Can't Find Project or Library
I have a spreadsheet containing 7 userforms and 9 modules. The spreadsheet has been developed on the same computer for a number of years and remained stable. However, I now want to make some amendments to one of the userforms. Whenever I make any changes to the UserForm_Initialize statement (even entering a blank space), I get the compile error 'can't find project or library'. Does anyone know why this happens and, more importantly, how to stop it. ...

Quote Number
I would like for users to go into a form and reserve a quote number. Would like the quote number to be auto-assigned using mmddyy (then count 01 to xx for the day) followed by their initials. Basically result would be 02280801TR for the first then 02280802TR etc....Not mandatory for the Initials if you could solve the autonumber mixed date field...Initials could be another field in the database and could combine later. Thanks Tony, I would place the below on the AddNew button: DoCmd.GoToRecord , , acNewRec Me.txtQuoteID = StrReverse(Format(Date, "mm")) & Format(Date, &quo...

Run macro automatically.
How do I make a macro run automatically when a worksheet it is attached to is loaded? right click on the sheet tab>view code>left window worksheet>right window activate -- Don Guillett SalesAid Software donaldb@281.com "Excel macro" <Excel macro@discussions.microsoft.com> wrote in message news:DD7AF1E3-9263-4523-AC49-A43ABA1AB9D0@microsoft.com... > How do I make a macro run automatically when a worksheet it is attached to is > loaded? I am unable to find "activate " when I right click on worksheet. ( i assume that you are referring to the windo...

Help with macro/and or formula?
Perhaps this is a silly question, but i just can't figure out how t format this worksheet. The problem is that a lot of the cells hav numbers in them with negative signs in the back instead of in the fron (ie. 23-) and i was wondering if anyone knew of a macro/formula i coul use to quickly fix this problem for all the cells. I would b extremely grateful. Thanks -- brefed1 ----------------------------------------------------------------------- brefed15's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3557 View this thread: http://www.excelforum.com/showthre...

Attached Toolbars Macros
Excel 2003 I have a custom tool bar, this tool bar has several items, each item is pointing to a VBA code. This tool bar is attached to the worksheet. I've copied this spreadsheet to several computers. After I copied the spreadsheet I decided to rename the spreadsheet, after I renamed the spreadsheet the Toolbar Item's macros were still pointing to the old name, I reasigned each tool bar item to the current spreadsheet, saved the spreadsheet and everything was working on my computer, but when I re-copied the new spreadsheet to other computers and I clicked on the Toolbar Item...

How to setup online access to multiple accounts in one institution
I am using Money 2004 Small Business. I have 4 different accounts with Ameritrade, each account has a different online account ID and pin number. Money does not appear to let me setup all four accounts for activity download, it appears to permit only one set of account login info per institution. Is Microsoft short sighted in designing this or I am missing something? Please help, your effort will be greatly appreciated. Matt In microsoft.public.money, Admin wrote: >I am using Money 2004 Small Business. I have 4 different accounts >with Ameritrade, each account has a different onl...

Protected sheets and running macros
i have a sheet with a macro ran by a normal button at the top. Howeve when i protect the worksheet where ever i click on the sheet the macr executes. Can any one offer any advice on how to stop this? Thanks Robert -- Message posted from http://www.ExcelForum.com hi, i am not able to reproduce the problem, hence i may not be able t provide a panacea for that issue. here is what i suggest. i have a sheet that has a macro that is run when a control toolbo button (that is, not a form button) is clicked. this sheet is protected based on the user logged in. what i have don is to protect t...

Macro to remove rows?
Hi, I receive thousands of rows of data from an extract that comes from a database. The data extract automatically generates page headers that need to be removed, and I would love to automate this process. The headers do have a pattern to them, but I'm not clever enough to figure out a good way to use that to write a macro. The first row of the header starts with hyphens ------------------------------- Then there's a variable number of rows of header data to delete followed by another row of hyphens ------------------------------- Then 2 additional rows that must be deleted. The nu...

Macro Freezes Reading Pane
I have a macro that Sends/Receives Tasks from Project Server into Outlook Tasks. Everything is working fine, except one weird thing that happens. I have the Timer set on the macro and it starts as soon as Outlook starts. The macro gets the tasks from ProjectServer every hour. As soon as the macro starts running the Reading pane freezes in the Inbox. If i stop the macro then Reading pane is back to normal. Can anyone please tell me if there is something I can do in VBA to fix this annoying issue. Thanks a lot ...

transfer investment account from one .mny file to another
Hi, I am using Microsoft Money Plus Home & Business version 17.0.150.1415. I use it to keep track of my personal finances in one .mny file, and I use it to keep track of business finances in another .mny file. In the .mny file for my business, I just created an Investment account and added about ten stocks to it. I should have created this in my personal .mny file. Can anyone tell me if there is a way I can move this one investment account (and the stocks included in it) from my business .mny file to my personal ..mny file? Thanks in advance, Paul -- Paul Kraemer In m...

Calling on a macro within a macro!
Hey All!! Quick Question - How do you call up a macro within a current macro? I have one big macro and I need it to jump to several other macros when it runs! Does it matter where the other macros are stored or is it better to have them all in one module? Help appreciated Thnx! Hi Mellowe, '=============>> Public Sub Main() 'Your code Call One 'your code End Sub '<<============= '=============>> Public Sub One() MsgBox "Hi from One" End Sub '<<============= > Does it matter where the other macros are stored or ...

limit posting to default accounts
We are going through a major overhaul of our General Ledger and are marking accounts "Inactive" and do not "Allow Account Entry". However, if the account number we inactivated was stored in a recurring batch or as a default posting account in the vendor cards, transactions are accepted and can be posted to these "inactive" accounts without warnings or errors. Apparently, the flags are checked when the number is physically entered into a transaction entry window and not at posting. Our suggestion is that an additional check be performed at post to see if t...

Can i print copy numbers?
At my job we must print copies of databases and keep track of them. We only print 100 copies at a time. Is there a way to make it automaticly put "1 of 100" or "copy 1 of 100" in the footer?? You could run a little macro: Option Explicit Sub testme() Dim iCtr As Long For iCtr = 1 To 3 '100 when you're ready With ActiveSheet .PageSetup.RightFooter = "Copy " & iCtr & " of 100" .PrintOut preview:=True 'false when you're ready End With Next iCtr End Sub I used 1 to 3 and pri...

Problem using "Update retirement account" in Money 2005
I'm having trouble updating my 401k account using "Update retirement account" for my end of 2004 statement. There is one specific investement that produces the following error: "... will cause the balance of 'xx' held in this investment account to become negative at some point. Please cancel or revise the transaction." If I try to do the "Dividend" and the "Buy" transactions manually then I get the following error when I try to do the "Dividend" transaction: "You have not purchased 'xx' in this Investment Account...

shortcut keys to macros
Hi, Is it at all possible to assign shortcut keys to macros in Outlook? Thx, Hans ...

help Unable to record Macro !!!!!!!
I want to record a macro in excel.But as soon as I click record Macro it says "unable to record" macro. Got no help in excel help.I do this same thing in word and it's working. Please help It's urgent for me !!!1 Have a look here http://groups.google.com/groups?as_epq=unable%20to%20record&as_ugroup=microsoft.public.excel.* -- Don Guillett SalesAid Software donaldb@281.com "ash" <anonymous@discussions.microsoft.com> wrote in message news:3e0b01c42ae5$45333e00$a401280a@phx.gbl... > I want to record a macro in excel.But as soon as I click > record...

Macro that password protects a sheet
I am attempting to create a macro that can open a protected sheet, change something, and then protect it again. I continue to have an issue with the macro not entering the password. Is this possible to do/fix? Thanks, Ryan ..open password="mypassword" -- Don Guillett SalesAid Software donaldb@281.com "Ryan" <Ryan@discussions.microsoft.com> wrote in message news:D4780ED8-CA1D-4284-97BC-3576160D998E@microsoft.com... > I am attempting to create a macro that can open a protected sheet, change > something, and then protect it again. I continue to have an iss...

Footer Macro?
Hi Months ago I read a Public Sub Macro that read the selection of a drop down list in a combo box and placed it in the center Footer at the same time it also placed the date in the right Footer and tme in the left footer. I have searched most of the regular sites including this one and cannot find it anywhere --- Can anyone help with my search. Any help much appreciated Cheers ---- Mully ...