PC Review


Reply
Thread Tools Rate Thread

Can VBA copy all procedures from one worksheet module to another?

 
 
=?Utf-8?B?SmF5?=
Guest
Posts: n/a
 
      28th Mar 2007
Hi All -

Is there a way to programmatically copy VBA code from one worksheet module
to another in the same workbook?

Copying the worksheet (and its code module) is not an option because we are
looping through many copies and run into the documented Excel error
associated with copying too many worksheets in the same workbook.

Need something similar to Export File... and Import File..., but for
worksheet modules. Also, it would be desirable not to have to export to an
external file if possible.

--
Jay
 
Reply With Quote
 
 
 
 
=?Utf-8?B?SkxHV2hpeg==?=
Guest
Posts: n/a
 
      28th Mar 2007
Chip Pearson has some code that might help:

http://www.cpearson.com/excel/vbe.htm#CopyModule

If you don't want to copy the whole module, browse around his site, I'm sure
you can find something that will help.

"Jay" wrote:

> Hi All -
>
> Is there a way to programmatically copy VBA code from one worksheet module
> to another in the same workbook?
>
> Copying the worksheet (and its code module) is not an option because we are
> looping through many copies and run into the documented Excel error
> associated with copying too many worksheets in the same workbook.
>
> Need something similar to Export File... and Import File..., but for
> worksheet modules. Also, it would be desirable not to have to export to an
> external file if possible.
>
> --
> Jay

 
Reply With Quote
 
=?Utf-8?B?SmF5?=
Guest
Posts: n/a
 
      28th Mar 2007
Thanks JLGWhiz. I'm adapting some of Chip's code now.
--
Jay


"JLGWhiz" wrote:

> Chip Pearson has some code that might help:
>
> http://www.cpearson.com/excel/vbe.htm#CopyModule
>
> If you don't want to copy the whole module, browse around his site, I'm sure
> you can find something that will help.
>
> "Jay" wrote:
>
> > Hi All -
> >
> > Is there a way to programmatically copy VBA code from one worksheet module
> > to another in the same workbook?
> >
> > Copying the worksheet (and its code module) is not an option because we are
> > looping through many copies and run into the documented Excel error
> > associated with copying too many worksheets in the same workbook.
> >
> > Need something similar to Export File... and Import File..., but for
> > worksheet modules. Also, it would be desirable not to have to export to an
> > external file if possible.
> >
> > --
> > Jay

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
List all procedures within a module K Microsoft Access VBA Modules 3 15th Oct 2008 02:17 PM
COPY MODULE MACRO WITH WORKSHEET TO OTHER WORKBOOKS K Microsoft Excel Programming 2 19th Feb 2008 05:34 PM
Dynamically create procedures in a sheet module Frederick Chow Microsoft Excel Programming 2 13th Sep 2006 11:03 PM
calling standard module procedures from event procedures =?Utf-8?B?b3NzaWFu?= Microsoft Access VBA Modules 2 9th Feb 2006 01:26 PM
How to CALL procedures from the module =?Utf-8?B?Sm9sb2dz?= Microsoft Access Form Coding 1 25th Jul 2005 08:16 AM


Features
 

Advertising
 

Newsgroups
 


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