Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Can VBA copy all procedures from one worksheet module to another?

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Can VBA copy all procedures from one worksheet module to another?

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Can VBA copy all procedures from one worksheet module to anoth

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you use "Target" in a Module besides the worksheet module [email protected] Excel Programming 2 January 30th 07 08:30 PM
Dynamically create procedures in a sheet module Frederick Chow Excel Programming 2 September 13th 06 11:03 PM
Calling worksheet module from other module. Michael Malinsky Excel Programming 2 December 14th 05 08:47 PM
Run worksheet module code from workbook module? keithb Excel Programming 1 August 14th 05 04:04 AM
calling procedures from worksheet buttons Anthony[_6_] Excel Programming 2 July 23rd 05 11:17 AM


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

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

About Us

"It's about Microsoft Excel"