+ Reply to Thread
Results 1 to 7 of 7

Copying a UserForm

  1. #1
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Copying a UserForm

    I want to make a few user forms which have near identical properties (size, text boxes, buttons, images, etc) but there's no option to copy/paste the user form in the VBA editor. How do I make these copies?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  2. #2
    Registered User
    Join Date
    08-01-2012
    Location
    Montreal, Qc, Canada
    MS-Off Ver
    Excel 2010
    Posts
    82

    Re: Copying a UserForm

    not sure if it can be done... What I have done in the past was

    1- open 2 different instances of excel (and the VBA explorer)
    2- move the UserForm to the second excel (drag and drop), this will make a copy of it in the new excel file
    3- change the name and then drag it back..

    repeat step 3 as often as needed.

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Copying a UserForm

    Can't you just use the same userform?

    Failing that, export the form (right click > export), then re-import

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Copying a UserForm

    Thanks, opening up two instances worked. The two forms will be different enough that I don't want to code hiding buttons and such. I tried exporting and importing but it gave me an error.

    Thanks!

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Copying a UserForm

    Hi ChemistB

    Kyle's approach is right on except, after you've exported the UserForm and BEFORE you re-import it, change the Name of the UserForm in the Workbook. The Import will not work if the UserForm already exists in the Workbook.

    So, if the Name of the UserForm is myForm:
    • Export myForm
    • Change the Name of myForm to myForm1 (in the Workbook)
    • Import myForm
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Copying a UserForm

    Thanks John. That works.

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Copying a UserForm

    You're welcome...glad I could help. Thanks for the Rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] userform not copying all to sheet
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-17-2013, 02:20 PM
  2. Copying Cell Value with Userform Click
    By dzags18 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-13-2013, 03:55 PM
  3. Copying a UserForm
    By MWE in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-25-2013, 03:18 AM
  4. Copying a userform from one project to another
    By calmena in forum Excel General
    Replies: 5
    Last Post: 03-23-2011, 11:06 AM
  5. Copying Userform?
    By redjay in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-09-2008, 07:45 AM
  6. Copying a Userform within the same project
    By needyourhelp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-18-2005, 09:05 PM
  7. Copying Userform
    By Marcia3641 in forum Excel General
    Replies: 3
    Last Post: 07-21-2005, 04:05 PM
  8. Copying a userform into a new workbook
    By jase in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-25-2005, 02:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1