copying modules and links

  • Thread starter Thread starter Bob Meixner
  • Start date Start date
B

Bob Meixner

I have a workbook that contains VB macros(Excel). I want to copy certain
sheets from this workbook to another workbook and share it with others.
However, when I do this and send it to them, the macro refers back to my
original workbook.

Example: a simple button(macro assigned to it) is used to navigate to
certain sections of the worksheet works fine in original. But when I copy
it to a new book, it tries to "link" back(find) to the original(even though
I have copied the corresponding macro module to the new workbook). Is there
an easy way to just tell it to look for the module with the same name
"locally"?

Sorry if this is an easy one; I just can't find answer in the "help".

Thanks, Bob
 
Make a copy of the entire workbook, then edit that workbook to remove any
extra sheets you don't want. Send that copy to them.

You can either open Excel, open the workbook, use SaveAs to save under a new
name to get the new book, or just use Windows Explorer to make a copy of the
file.
 
Hi Bob,

Right-click on the button and choose "Assign Macro". In the Macro name
field, the part before the "!" is the worksheet that contains the sub.
Change it to the current workbook or delete it altogether (including
the "!").

Regards,
Steve
www.stkomp.com
 
If you were to use the commandbutton from the control toolbox toolbar, then the
code for that commandbutton would be behind that sheet.

And when you copy the sheet to a new workbook, the code would copy over, too.

If you can replace that button with a commandbutton, you may find it easier.
 

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