COPY MODULE MACRO WITH WORKSHEET TO OTHER WORKBOOKS

K

K

Hi, I have macro setup on a button in one of my worksheet. Lots of
other people also have
to use that worksheet for their work purpose. But to use that
worksheet they need to
copy that worksheet into their workbooks or Excel Files and the best
way to copy that
worksheet (with which they can get all the formulas and other formats)
is to right click
on that worksheet tab and click "Move or Copy" comand to transfer it
to their workbooks.
The problem is that when they get copy of my worksheet in their
workbooks or files and
when they click that button in which the macro is setup to work then
by clicking that
button it openes up the original worksheet aswell. I want someway
that when they copy
my worksheet into their workbooks then they should also get the macro
to be copied
aswell. I know the copy method I mentioned above will copy the
worksheet macro
but how to copy the Module macro. Please if anybody can help in
this. Thanks
 
D

dan dungan

Hi,

Please show the macro code so we can see what may be causing your
problem.

Dan
 
P

paul.robinson

Hi
Other people should copy the workbook, not the worksheet. The code is
part of the workbook, not the worksheet.
When you copy the worksheet, the macro name "test" in workbook
"myworkbook.xls" on drive "I:\" becomes "I:\myworkbook.xls!test" in
the workbook where the sheet is copied. Hence the macro has to open
your workbook to run.
regards
Paul
 

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