Copy worksheet, code and all, into workbook?

E

Ed

Can I create a worksheet with command buttons, hyperlinks, and code in the
worksheet module, and then copy this entire sheet with everything intact
into a new workbook?

Ed
 
R

Ron de Bruin

Yes you can Ed

Sheets("Sheet1").Copy will create a new workbook with that sheet.

Only you must use buttons from the Control toolbox and place your code in the click event.
The button will always follow the click event and this is in the sheet module.

If you use a Forms button and assign a macro to it
The macro is in a normal module and not
in the sheet module so this will not work
 
E

Ed

Thank you, Ron. I'll work with this. If things start smoking, I'll yell
for help! 8>)

Ed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top