MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Copying a Userform

Posted by Raishon on May 24, 2001 9:47 AM

I have a spreadsheet that has a command button that opens a userform. Is there a way to connect a userform to one sheet in a workbook so when the sheet is copied to a new workbook the userform also is copied?

Posted by Dave Hawley on May 24, 2001 9:37 PM

Hi Raishon

It could probably be done but it would involve some pretty serious coding. If I were you i would take another approach. Instead of copying the Sheet Object to a new Workbook create a New Workbook and in it place the userform and code. Now save this Workbook as a template. So now when you copy your sheet, copy it to the Template instead. Easiest way to get the code is to simply record yourself going to File>New and selecting your Template.

You can also simply drag and drop your userform (while in the VBE) into the template workbook before saving it.


OzGrid Business Applications