ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can VBA copy all procedures from one worksheet module to another? (https://www.excelbanter.com/excel-programming/386181-can-vba-copy-all-procedures-one-worksheet-module-another.html)

Jay

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

JLGWhiz

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


Jay

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



All times are GMT +1. The time now is 10:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com