![]() |
copying modules and links
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 |
copying modules and links
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. "Bob Meixner" wrote: 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 |
copying modules and links
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 Bob Meixner wrote: 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 |
copying modules and links
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. Bob Meixner wrote: 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 -- Dave Peterson |
All times are GMT +1. The time now is 02:17 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com