How to assign macro coding into customized button?

E

Eric

Does anyone have any suggestions?

Customize your Toolbar by placing a button on it and assign the following
macro to
that button.

Tools>Customize>Commands>Macros.

Drag smiley face to your Toolbar.


The given Micro coding
Sub Macro1()
Workbooks.Open Filename:="E:\folder\filename.xls", UpdateLinks:=3
End Sub

Does anyone have any suggestions on how to assign the following code into
the button?

Thanks in advance for any suggestions
Eric
 
J

Jacob Skaria

Click on the button. The macro list will populate..Select the macro from the
list.

If this post helps click Yes
 
E

Eric

Thank you very much for suggestions
Could you please give me any suggestions on how to place the coding into
macro? so I can select the macro from the list.
Thank you very much for any suggestions
Eric
 
J

Jacob Skaria

Hi Eric

--Set the Security level to low/medium in (Tools|Macro|Security).
--From workbook launch VBE using short-key Alt+F11.
--From VBE menu 'Insert' a module and paste your macro in the code pane.
--Get back to Workbook.
--You can either run macro from Tools|Macro|Run <selected macro() or click
on the toolbar button and assign the macro..

If this post helps click Yes
 
E

Eric

Thank you very much for suggestions
I have inserted the macro code into button, but when I move the workbook
file into different directory, the button cannot run the missing macro from
this workbook, could you please give me any suggestions on how to edit the
path on linking to macro coding for button?
Thank you very much for any suggestions
Eric
 

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