A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Move/Copy Worksheet with Macros



 
 
Thread Tools Display Modes
  #1  
Old October 9th, 2009, 05:38 PM posted to microsoft.public.excel.misc
Hansplay
external usenet poster
 
Posts: 5
Default Move/Copy Worksheet with Macros

When I copy a set of worksheets from one workbook to another the macros don't
follow.

Let me Explain:

I copy worksheets from workbook A into workbook B and close workbook A.
Then from workbook B I select the command button to run a macro. What
happens is workbook A opens again and runs the macro. If I break the link
with workbook A in workbook B using Edit/Links the command button doesn't do
anything.

How can I move the worksheets into the new workbook and have them behave as
they did originally?

Thanks
  #2  
Old October 9th, 2009, 05:46 PM posted to microsoft.public.excel.misc
Gary''s Student
external usenet poster
 
Posts: 7,584
Default Move/Copy Worksheet with Macros

A tiny trick:

Rather than copy sheets from Book A to Book B, make a "Book B" by making a
copy of Book A, removing material you don't want in B, adding material you do
want in B and then calling the modifed copy Book B.

The point is that by copying Book A, you will also copy all the included
macros.
--
Gary''s Student - gsnu200907


"Hansplay" wrote:

When I copy a set of worksheets from one workbook to another the macros don't
follow.

Let me Explain:

I copy worksheets from workbook A into workbook B and close workbook A.
Then from workbook B I select the command button to run a macro. What
happens is workbook A opens again and runs the macro. If I break the link
with workbook A in workbook B using Edit/Links the command button doesn't do
anything.

How can I move the worksheets into the new workbook and have them behave as
they did originally?

Thanks

  #3  
Old October 9th, 2009, 05:51 PM posted to microsoft.public.excel.misc
Hansplay
external usenet poster
 
Posts: 5
Default Move/Copy Worksheet with Macros

Thanks for the quick response. The only problem with that is "Book B" also
contains macros that I need to keep. I am combining two workbooks, each
containing several macros.

Thanks.

"Gary''s Student" wrote:

A tiny trick:

Rather than copy sheets from Book A to Book B, make a "Book B" by making a
copy of Book A, removing material you don't want in B, adding material you do
want in B and then calling the modifed copy Book B.

The point is that by copying Book A, you will also copy all the included
macros.
--
Gary''s Student - gsnu200907


"Hansplay" wrote:

When I copy a set of worksheets from one workbook to another the macros don't
follow.

Let me Explain:

I copy worksheets from workbook A into workbook B and close workbook A.
Then from workbook B I select the command button to run a macro. What
happens is workbook A opens again and runs the macro. If I break the link
with workbook A in workbook B using Edit/Links the command button doesn't do
anything.

How can I move the worksheets into the new workbook and have them behave as
they did originally?

Thanks

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:49 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.