+ Reply to Thread
Results 1 to 8 of 8

VBA macros library

Hybrid View

  1. #1
    Registered User
    Join Date
    01-11-2020
    Location
    Norway
    MS-Off Ver
    Microsoft Office 2019
    Posts
    74

    VBA macros library

    Hi!

    For us who are not frequent users of macros, but do so from time to time, it can be a little bit challenging to remember stuff. To be honest, if I have not used it in some months, I even forget how to write the start of the code

    So, my question is basically the following, is it possible to create a library with macros that you can easy access when excel is open (without opening any sheets)? I am basically thinking of a library with modules where you can sort different codes and such. Is this possible to create?

    Then my second question, if this is possible to create, are there any good libraries out there that you can use? Or do you create everything from scratch?


    Thanks in advance

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,841

    Re: VBA macros library

    I put all of my general-purpose macros in the file PERSONAL.xlsb. This file is created by default in the Excel Startup folder, and so is opened every time you open Excel. It defaults to be hidden. If you go to your macro project navigator (ALT+F11) you should see it on the left as the first file.

    I am not aware of any libraries of general-purpose code you can download. There are some packages that are available as add-ins, though many that I've seen are commercial products with protected code.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,875

    Re: VBA macros library

    What do you want a library of codes to do?

    When I was developing code for clients, each workbook needed to be free standing so, in all honesty, I’ve never used a library. For me, there was no point calling on a routine in a PERSONAL.xlsb, because it wouldn't be available when I handed over the workbook to the client.

    The easy way, for me, was to create an .xlsm workbook and have specific named modules for specific functions, or groups of functions. For example, you might have functions to get the first row, last row, first column, last column, number of rows, number of columns, whatever. Then, when you need a specific function in a workbook, just copy and paste it from your "memory book".

    All that said, I code most things from scratch and, if I can't remember something, I’ll record a macro to get the basic structure and then adapt it.

    Chances are, if you just copy and paste stuff, you'll never commit the basics to memory.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,254

    Re: VBA macros library

    Many tools that make it easier to build code include predefined code libraries, or at least allow you to save snippets for re-creation. I use two such tools: Code VBA and MZ-Tools. The code library itself can be opened outside of Office: Total Visual SourceBook. All of these are paid tools, of course.
    But I can provide a demo version of an add-in of my own making for saving code snippets. It is possible to save snippets in five groups, 10 snippets in each group. Each snippet can be edited or deleted at any time. So you have the possibility to save up to 50 snippets.
    After downloading, the zip file needs to be unzipped. In the file manager, call up the pop-up menu from under the right click, select Properties and remove the lock (if it exists). Only then can the add-in be installed in Excel.
    In the VBA editor, an "Insert Fragment" icon will appear at the beginning of the Edit toolbar to call the tool.


    Artik
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-11-2020
    Location
    Norway
    MS-Off Ver
    Microsoft Office 2019
    Posts
    74

    Re: VBA macros library

    Thanks for all the answers!

    TMS, I see your point, no doubt about it, but as you wrote "making a code for a client", means that you probably do a lot of coding. I am an engineer and I use macros from time to time, but not often enough to remember stuff. That's why I kinda need a little "help" getting there

    Artik, thanks for the file, the file requires a password (when opening in excel VBA), do you have the password available?

  6. #6
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,254

    Re: VBA macros library

    The provided add-in does not require a password to work with it. But it is an add-in for work, not for learning, so I do not anticipate making the password for the project public.
    If 50 excerpts are not enough, you can always save a few/more than a dozen excerpts in one entry. After pasting into the code, remove the fragments that are unnecessary at the time.

    Artik

  7. #7
    Registered User
    Join Date
    01-11-2020
    Location
    Norway
    MS-Off Ver
    Microsoft Office 2019
    Posts
    74

    Re: VBA macros library

    Quote Originally Posted by Artik View Post
    The provided add-in does not require a password to work with it. But it is an add-in for work, not for learning, so I do not anticipate making the password for the project public.
    If 50 excerpts are not enough, you can always save a few/more than a dozen excerpts in one entry. After pasting into the code, remove the fragments that are unnecessary at the time.

    Artik
    Thanks, now I understand how it works.

    I can see that it is completely blank, so I will have to make every fragment myself, is this correct?

  8. #8
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,254

    Re: VBA macros library

    It is empty, because it is thus tailored to the level of knowledge and needs of each user.

    Artik

+ 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. Library Spread Sheet, with add new book macros
    By lewashby85 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-05-2017, 02:33 PM
  2. [SOLVED] 32 bit Library DLL 'olepro32.dll' vs 64 bit Library 'oleaut32.dll'
    By ELeGault in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-21-2017, 10:59 AM
  3. Library System using excel macros
    By grewrtyhui in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-13-2015, 07:26 PM
  4. Automation Error Library Not registered when trying to write macros for visio diagram
    By enramya82 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-01-2014, 09:09 AM
  5. ADO 2.8 library
    By ravishukla884 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2012, 06:46 AM
  6. Can't find project or library - MS Forms 2.0 Ojbect Library
    By RTSmith in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-11-2012, 06:51 PM
  7. Use same ADO library again
    By richmoijn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-30-2008, 08:25 AM

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