+ Reply to Thread
Results 1 to 4 of 4

How to use a UserForm in any excel file, not only in the one in which the UserForm locates

  1. #1
    Forum Contributor
    Join Date
    04-19-2016
    Location
    Michigan
    MS-Off Ver
    15.0
    Posts
    130

    How to use a UserForm in any excel file, not only in the one in which the UserForm locates

    So, I have a simple UserForm to query data from a ComboBox save in one of the tabs of an Excel file that I leave open at work:

    Please Login or Register  to view this content.

    The source of data looks something like this:

    g1ZMbgB.png

    With names assigned so I can query data using 2 variables:

    qFPrX1m.png

    Everything works great and all, but I would need to run this macro from this worksheet, in order to get this dialogue:

    0z5HPyo.png

    Is there anyway to do it so that I can run this macro (by adding a button in the ribbon, for example) from any random excel spreadsheet so I can query for this data and get the form above, as opposed to something like this:

    tcSQuIB.png

    Thanks for your help!

  2. #2
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: How to use a UserForm in any excel file, not only in the one in which the UserForm loc

    Yes,
    you can save the userform in your Personal Macro Workbook. To create one, record a macro and choose 'Personal Macro Workbook' from the drop down list. You can then copy your userform there (Ctrl>Drag it) and hit the save button in the VB Editor.

    Capture.PNG

    Alternatively, you can save the workbook with the UserForm as an Add-In

    Capture 2.PNG

    As long as you have the add-in enabled, in File>Options>Add Ins> Manage Excel Add Ins, then the user form will be available
    Last edited by Neil_; 09-28-2016 at 10:28 AM.
    Frob first, tweak later

  3. #3
    Forum Contributor
    Join Date
    04-19-2016
    Location
    Michigan
    MS-Off Ver
    15.0
    Posts
    130

    Re: How to use a UserForm in any excel file, not only in the one in which the UserForm loc

    Hmm, I tried save as add in, then activate it in the add in manage option (then add macro into my menu using the customize ribbon function) but the form is still not populate correctly.

    I will try with the personal work book thing. Would I need to copy the worksheet that contains my list as well? Thanks!

  4. #4
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: How to use a UserForm in any excel file, not only in the one in which the UserForm loc

    No, just the Userform. You need a method of launching it. If you create a macro with Userform1.Show as the line of code (either in the Personal Macro Workbook in a new module, or the same in the add-in), you can then assign a button to it by customizing your Quick Access toolbar and adding it.
    Capture3.PNG
    Last edited by Neil_; 09-28-2016 at 11:52 AM.

+ 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. combining chart userform and data transfer userform into 1 userform
    By H_Kennedy in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-04-2014, 07:11 AM
  2. [SOLVED] Excel 2007, Userform Textbox Date Format and Calendar Control Userform
    By riffology in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-03-2014, 06:18 PM
  3. combining chart userform and data transfer userform into 1 userform
    By H_Kennedy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-03-2014, 12:28 PM
  4. Storing data from Userform to Shared Excel file wothout opeing the excel file.
    By d.balaji.naik in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-19-2013, 07:37 PM
  5. [SOLVED] Open a userform from a userform, but preserve the info in the original userform
    By jfoerch in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-25-2013, 02:38 PM
  6. [SOLVED] EXCEL USERFORM- pull data from sheet 1 into userform
    By PANTECH in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2013, 11:10 AM
  7. Replies: 1
    Last Post: 10-05-2005, 07:05 PM
  8. [SOLVED] UserForm Question:Is it possible to save and close a file via a userform.
    By jer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-13-2005, 08:06 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