how do I keep a macro with spreadsheet when moved

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 

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

Back
Top