ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy form and code question (https://www.excelbanter.com/excel-programming/274577-copy-form-code-question.html)

Stuart[_5_]

Copy form and code question
 
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



Rob Bovey

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





Stuart[_5_]

Copy form and code question
 
Many thanks.

I thought there must be an easier way.

Regards.

"Rob Bovey" wrote in message
...
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






---
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




All times are GMT +1. The time now is 11:22 AM.

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