ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copying Worksheets with macros (https://www.excelbanter.com/excel-programming/409677-copying-worksheets-macros.html)

WLMPilot

Copying Worksheets with macros
 
I am setting up a template (worksheet) for someone to copy as needed.
Attached to this template are macros and a userform.

I am setting up this template to use a userform to enter checking account
transactions and each worksheet will be a check register.

My question is this: Do macros and userforms copy along with the worksheet
that is being copied?

Thanks,
Les

Mike Fogleman[_2_]

Copying Worksheets with macros
 
Code in the worksheet module will be copied with the worksheet, but
userforms and general modules will not be copied. For that the entire
workbook should be copied.

Mike F
"WLMPilot" wrote in message
...
I am setting up a template (worksheet) for someone to copy as needed.
Attached to this template are macros and a userform.

I am setting up this template to use a userform to enter checking account
transactions and each worksheet will be a check register.

My question is this: Do macros and userforms copy along with the
worksheet
that is being copied?

Thanks,
Les




Jacques ALARDET

Copying Worksheets with macros
 
Hello,

1. If your macro is stocked in the module of the Worksheet : The code is
copied of the same time workshheet
2. If your macro is stocked in other module : You copied the code by
Export-Import
3. If your macro is stocked in Thisworkbook : the export-Import create a
class module
4. If your macro is stocked in Userform : I have not response

But I recommande the stockage of macro in a workbook independant out of the
workbook user : In this cas no besoin to copy the code


--
J a c q u e s

"WLMPilot" a écrit dans le message de
...
I am setting up a template (worksheet) for someone to copy as needed.
Attached to this template are macros and a userform.

I am setting up this template to use a userform to enter checking account
transactions and each worksheet will be a check register.

My question is this: Do macros and userforms copy along with the
worksheet
that is being copied?

Thanks,
Les



Barb Reinhardt

Copying Worksheets with macros
 
If you are copying the worksheets with code, you can add some more to copy
the needed worksheet modules as well.

This should get you started.

http://www.cpearson.com/excel/vbe.aspx

Just make sure you have a backup copy of your file before you start. :)
--
HTH,
Barb Reinhardt



"WLMPilot" wrote:

I am setting up a template (worksheet) for someone to copy as needed.
Attached to this template are macros and a userform.

I am setting up this template to use a userform to enter checking account
transactions and each worksheet will be a check register.

My question is this: Do macros and userforms copy along with the worksheet
that is being copied?

Thanks,
Les



All times are GMT +1. The time now is 05:51 AM.

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