Recording a macro

D

Denise Payne

I am using Excel.
What I am trying to do is use a Command Button to link to a macro that will
open a speadsheet from another file(Spreadsheet 1), then update another
spreadsheet(Spreadsheet 2) from the first spreadsheet. Then, close
everything. It is modeling data and there are 4323 rows and 50 columns. I am
trying to create a command on one spreadsheet that will update the data at
the touch of a button.
 
D

dustinbrearton via OfficeKB.com

I take it from the below that you have the macro already complete? If you
just need a command button try going to View-ToolBars and then select the
formatting toolbar. Once that comes up as long as the bar has not been
changed the sixth button from the left should be a button to insert a command
button. Just click it select where you want the button. once the button is
on the sheet just double click it. That will open VBA Editor and show an on
click event for the button. Put the name of your macro in the Sub that was
created and your button should now execute the Macro that you recorded.
 
D

Denise Payne

I recorded the macros, but they do not appear to be running. For instance,
the first macro I recorded was Open099UPDATE which is a .xls file. The way I
recorded the macro was this way:
1. I opened Tools, Macro, Record
2. Then I clicked through the steps to open that spreadsheet.
3.I clicked Stop Recording
Now, when I ran the macro, nothing happened.
What did I do wrong?
 
J

Joel

The best way of determining what is happening is to add break points and step
through codce. Press ALT F11 to view code. Click on first line of macro and
press F9. You should be able to go to the speadsheet and start macro as you
did before. The macro should stop on 1st line of code. You can Press F8 to
step through macro or add more break points using F9 and run code by pressing
F5. This shoudl get you started. for simple macros. Find out where the code
stops running.
 

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