View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob Bovey Rob Bovey is offline
external usenet poster
 
Posts: 811
Default Copy form and code question

Hi Stuart,

There's actually a very simple way to do this. Open a new blank workbook
in Excel. Switch back to the Visual Basic Editor and add the UserForm you
want to copy to the VBProject of the new blank workbook. You can do this by
selecting the UserForm in the Project window and then dragging and dropping
it onto the project of the new blank workbook. In the new blank workbook,
rename the UserForm, then drag and drop it back into the original project.
Finally, close the intermediate workbook without saving. You'll now have a
new copy of your UserForm with a different name in the original project.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *


"Stuart" wrote in message
...
I need a new form. In that project there is already a form
very similar to the new one I need.
Rather than build it from scratch, is there a way to copy
the form (and code behind it) and rename it. Then I'd
only have to make the neccessary changes?

Is the best way to export it, then rename it, then import
it back into the project?

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.509 / Virus Database: 306 - Release Date: 12/08/2003