move/copy a userform from one workbook to another

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

mrl

Thread Starter
Joined
Aug 12, 2007
Messages
342
Hi,
Is there a way to move/copy a Userform from one workbook to another. I'm making a new workbook and want to use a userform that I already formatted that's in a different workbook. I don't want to have to redo the formatting if I don't have to.


Mike
 
Joined
Jul 1, 2005
Messages
8,546
Dragging a form from one wb to another in Project Explorer seems to work OK in Excel 2K (CTRL+drag to copy rather than move).

HTH :)
 

mrl

Thread Starter
Joined
Aug 12, 2007
Messages
342
Hi bomb #21,
Happy New Year
Yep, it works in 2007, too. Thank You for the help.
Now I have a problem of calling it from another userform. I renamed it "Minutes" but I get an error when I use code from another userforn. Here is the code"
HTML:
Private Sub ListBox1_Click()
Select Case Me.ListBox1.Value
      Case Is = "Minutes":
      Minutes.Show
End Select
Unload Me
End Sub
Both userforms are in the same workbook. I tried to re name it back to userform2 and use "Userform2.show" with the same error results.
I also get the error when I try to use the following:
HTML:
Sub Test() 
Minutes.Show
        ' or if I change it to userform2.show
end sub

Mike
 
Joined
Jul 1, 2005
Messages
8,546
Now I'm in over my head. :D

If you add a button to "Minutes" with the line MsgBox Name & then run "Minutes" from the VBE (F5) what does the button "say" back?

(an alternative to dragging around in Project Explorer might be the "Export/Import" routine)

(edit: did you actually rename, or just change the caption maybe?)
 

mrl

Thread Starter
Joined
Aug 12, 2007
Messages
342
I didn't explain it well enough. Sorry about that :eek:

I made userform1 in a workbook. I wanted one of the items in the "listbox" to bring up another userform that I had made in a different workbook. Instead of remaking the second userform, I copied (draged it, as you taught me, thank you :D) it to the new workbook and am trying to refer to it in userform1. I can't get it to show either using the code in the userform, or if I put a code a module. I tried to rename it back what it was before I changed the name (userform2), which didn't help

Mike
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top