Copy worksheet, code and all, into workbook?

  • Thread starter Thread starter Ed
  • Start date Start date
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
 
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
 
Back
Top