how do I keep a macro with spreadsheet when moved

how do I keep a macro with spreadsheet when moved

Post by U3BlY2xBbm » Wed, 09 Mar 2005 11:51:02


I am trying to keep a macro with a workbook when I move it from my laptop to
my desk computer. I have to redirect the macro everytime I move the workbook
 
 
 

how do I keep a macro with spreadsheet when moved

Post by Dave Peter » Wed, 09 Mar 2005 23:08:30

It sounds like you're assigning the macro to a button/object/icon on a toolbar.

If that's the case, you may want to reassign the macro in code to the workbook
that owns the macro.

If you used a button from the Forms toolbar, a simple change may work for you.

Delete that button and use a commandbutton from the control toolbox toolbar.

Then double click on that commandbutton and have that code call your macro:

Option Explicit
Private Sub CommandButton1_Click()
Call myExistingMacro
End Sub


If you have trouble, you may want to post back with more details.



--

Dave Peterson