Consulting

Results 1 to 5 of 5

Thread: Is there a way to insert a permanent VBA userform to excel

  1. #1
    VBAX Newbie
    Joined
    Feb 2021
    Posts
    2
    Location

    Is there a way to insert a permanent VBA userform to excel

    Hello all,

    As my title. Is there anyways to install it to excel instead of the workbook. I don't have to re-import it when opening the new excel file.

    Thank you for your help

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Place it in "Personal.xlsm"
    If you don't yet have a Personal.*, record a macro and store it in Personal Macro Workbook, then import the form and delete the macro. Edit the Form to work on the "Active" Workbook.

    I would also add code like, "If ActiveWorkbook is Me Then Exit Form", to the Form
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,711
    Location
    What SamT said


    I have a number of 'general purpose' Userforms, Modules, and Classes in my Library.xlsm and Personal.xlsm which are save in my XLSTART folder as hidden workbooks (loaded every time, but not visible)

    You can drag and drop from those 'building block' files to a new workbook

    Capture.JPG
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,443
    Location
    If you save it as an addin, it is by default not visible. This is my preferred approach, I have a personal development addin with lots of useful functions et al like Paul, and with ribbon groups that I add to the Developer tab.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Newbie
    Joined
    Feb 2021
    Posts
    2
    Location
    Thank you all.


    I found a perfect solution. Add UserForm as the icon in the Developer tab


    https://excellencemadeeasy.com/2010/...lt-commands-2/

Posting Permissions

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