Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

COPY MODULE MACRO WITH WORKSHEET TO OTHER WORKBOOKS

2 views
Skip to first unread message

K

unread,
Feb 19, 2008, 11:44:10 AM2/19/08
to
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

dan dungan

unread,
Feb 19, 2008, 11:53:16 AM2/19/08
to
Hi,

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

Dan

paul.r...@it-tallaght.ie

unread,
Feb 19, 2008, 12:34:29 PM2/19/08
to
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
0 new messages