1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

move/copy a userform from one workbook to another

Discussion in 'Business Applications' started by mrl, Jan 19, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. mrl

    mrl Thread Starter

    Joined:
    Aug 12, 2007
    Messages:
    327
    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
     
  2. bomb #21

    bomb #21

    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 :)
     
  3. mrl

    mrl Thread Starter

    Joined:
    Aug 12, 2007
    Messages:
    327
    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
     
  4. bomb #21

    bomb #21

    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?)
     
  5. mrl

    mrl Thread Starter

    Joined:
    Aug 12, 2007
    Messages:
    327
    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
     
  6. Sponsor

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 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/975629

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice