How do I replicate a macro for each button on standard toolbar?

G

Guest

I am studying Excel macros. I have been given an assignment that says: "To
better understand the way that macros can be used to simplify our work, look
at the Excel toolbars. The buttons represent macros and scripts. See if you
can replicate the macros for each of the buttons on the Standard toolbar. If
there are any buttons you cannot replicate, explain why."
I have not a clue hpw to go about this.
 
G

Gord Dibben

Suzi

What the assigment wants you to do is see if you can write a macro that
replicates what each of the buttons does when clicked on.

The New File button opens a new workbook.

The Open button opens the dialog from where you can select a file to open.

The Save button saves the workbook you are working on.

Each of these can be replicated by Recording a macro while clicking the button.

Go to Tools>Macro>Record new macro.

Click on the New button and then Stop Recording.

Tools>Macro>Macros. Select Macro1 and Edit to see the code just produced.

You can follow these steps for each button on the Toolbar.

I don't know which ones you can replicate.....most I would assume but only you
and your recordings will tell.


Gord Dibben MS Excel MVP
 
G

Gord Dibben

Here is an example of a recorded macro from hitting the New button.

Sub Macro1()

' Macro1 Macro
' Macro recorded 02/16/2007 by Gord Dibben

Workbooks.Add
End Sub


Gord
 

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