button macro

G

Guest

I want to create a "menu" page that will take you to separate worksheets in a
workbook.

I can't seem to link the macros to the buttons....

I also want to send a worksheet to an e-mail recipient for approval, and
then forward it to another recipient, once approved.

I need the code for both the menu and the e-mail and instructions on how to
place the macro on the button.
 
G

Guest

I only want to send one worksheet, but I would like to send it to the
superintendent for approval using his e-mail address, and then send it to me
for processing. Is this possible?

Can you help me to understand how to assign macros to buttons, step by step.
I'm not a programmer and I have hyperlinks throughout the workbook. I would
prefer to use buttons as they look professional.
 
R

Ron de Bruin

There are two option for buttons

Forms tool bar
Control tool box

Right click on a toolbar and check the toolbar you want

You can draw a button from the toolbar on your sheet.

When it is a forms button you can right click on it and assign a macro to it that is in a standard module of the workbook
When it is a control toolbox button go in Edit mode first(first button on this toolbar)
Then double click on the button and the VBA edito will open with this

Private Sub CommandButton1_Click()

End Sub

You can add your code between the two lines and close the edit mode.
The advantage of this button is that if you copy the sheet to a new workbook you also copy the code
in the sheet module to the new workbook. Your button will work in the new workbook.

If you use a forms button your code will not work in the new workbook because it point to the old file
 
G

Gord Dibben

You can also assign a macro to any object you insert on a sheet, like a picture
of your mother-in-law or your favourite pub<g>


Gord Dibben MS Excel MVP
 
G

Guest

This is good information. Thanks! I'm sure I will have many more questions.

In the e-mail code. How do I know which parts of the code to copy to the
VBA module to get it to work?
 
R

Ron de Bruin

Download the example workbooks on my mail page and see a few examples working with a button.
 

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