Help. where's the #@%$&^ userform?

  • Thread starter Thread starter John
  • Start date Start date
J

John

I have a macro with userform and textbox. I want to copy the macro and
insert it in another workbook. I can copy the subs ok but where is the
userform and textbox?

I managed to create this beast but have no idea why it even works.
There's an ok button macro, a starting macro, a "call" to the userform.

userform.listbox... what does that mean? Show what? where's the form or
box template or whatever. I don't see it anywhere. But bingo... there it
is when I need it. I remember creating it but I don't remember saving it
anywhere. Very confusing.

The there is userform.show. Where is the d* userform that is being
shown? It's not in the macro list anywhere. How do I copy it and save it
etc.

help


John
 
The Listbox vba code fromt he userform etc will be found by double clicking
on the userform, not looking in a module.
 
In the VBA editor, click View - Project Explorer. You can find everything
there.

HTH, UpRider
 
The UserForm is not part of the worksheet. It exists at the application
level within a workbook VBA project. When you want it to appear you use the
..Show command and to put it away you can use Hide to leave it open but not
visible or you can Unload it to remove it from active memory. Once created,
it can be accessed for modification by pressing Alt + F11 to open the VBE and
it will be listed in the Project Window at the upper left side of the code
module window. You can right click the UserForm name and then select from a
pop up menu to view the object or to view the code.
 
Thanks. I didn't know that. But how can I copy or save it somewhere so I
can get it into another workbook?

I have the development workbook I use for development and dinging around
and the working workbook that gets used. Having developed the macro that
uses the UserForm in the development workbook, how do I move it to the
working workbook?

thanks
John
 
Select the form by name under Forms in your Project

Right-click and "Export File"

It will export as a *.frm file

Import that *.frm file into your working workbook.


Gord Dibben MS Excel MVP
 
Hi John, I had trouble getting back into the web site. Don't know what
happens at the MS communities site but every so often it goes berserk.
Anyhow, the easy way to copy or export or import a userform from one workbook
to another is to open both workbooks, then open the VB editor (Alt + F11) and
in the Project window, use the mouse to drag the form from one project and
drop it into the other. The VB editor will display the projects for all open
workbooks so be careful if more than two workbooks are open that you drop the
form in the correct project for the correct workbook. But this is the
easiest of all methods that I have found.
 
That worked great, thanks.
John
Hi John, I had trouble getting back into the web site. Don't know what
happens at the MS communities site but every so often it goes berserk.
Anyhow, the easy way to copy or export or import a userform from one workbook
to another is to open both workbooks, then open the VB editor (Alt + F11) and
in the Project window, use the mouse to drag the form from one project and
drop it into the other. The VB editor will display the projects for all open
workbooks so be careful if more than two workbooks are open that you drop the
form in the correct project for the correct workbook. But this is the
easiest of all methods that I have found.
 
Back
Top