+ Reply to Thread
Results 1 to 7 of 7

Multiple macros for several files that change weekly - where to store macros

  1. #1
    Registered User
    Join Date
    04-04-2017
    Location
    LEMONT
    MS-Off Ver
    Office 13
    Posts
    50

    Multiple macros for several files that change weekly - where to store macros

    Hello,

    I hope I describe my need so that someone can help. I don't know VBA very well.
    Each week I will get new Excel files. Some files will have a standard naming convention (i.e. ABC mm/dd/yyyy; month/day/year will represent the date data was generated). Some files the name will not have a standard naming convention. Also the worksheet names in the files will also be different; the names change by date generated. The one constant for all the files is the format of the data. While each file contains different data, there will be one key field among the various files that relate.

    I know how to create simple macros to perform repetitive tasks, insert column, filter, change a column color, etc. Since I am working with various files that change weekly, I can't create a macro in each of these files for repetitive use. Where would I store (keep) macros I create to use when I open specific files to perform repetitive tasks. Please note that I may have to share the macros with other users when there is a need for someone else to generate the require data.

    TIA,

    Kind regards,
    Jan

  2. #2
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Multiple macros for several files that change weekly - where to store macros

    some ideas -

    You could save it to your personal.xlsb file in the %appdata%\microsoft\excel\xlstart folder

    or you could save the macros in a file that you save as an addin and distribute the addin as needed.

    or save the add-in as read only in a shared drive and get everyone who wants to use it to add the addin to the addins in their excel. ( I do this so I can be constantly updating it and they can be constantly using the latest version)

    https://support.office.com/en-us/art...8-403625a0b460
    If you want something done right... find a forum and ask an online expert.

    Time flies like an arrow. Fruit flies like a banana.

  3. #3
    Registered User
    Join Date
    04-04-2017
    Location
    LEMONT
    MS-Off Ver
    Office 13
    Posts
    50

    Re: Multiple macros for several files that change weekly - where to store macros

    Hi Scott,

    Thank you for you quick replay and information.

    I will have to research the add in feature since I am not familiar with that process.

    Kind regards.
    Jan

  4. #4
    Registered User
    Join Date
    04-04-2017
    Location
    LEMONT
    MS-Off Ver
    Office 13
    Posts
    50

    Re: Multiple macros for several files that change weekly - where to store macros

    Hello,

    Ok, I have created an Add in. I see it listed on the Developer tab under Add-in. What I can't seem to figure out is how to use it with a new workbook that is opened.

    Any help will be appreciated.

    TIA

    Regards,
    Jan

  5. #5
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Multiple macros for several files that change weekly - where to store macros

    Go into the macro code and replace references to the specific sheet that you might have recorded with "activesheet" so it works on the active sheet not on a particular named worksheet.

    eg
    Please Login or Register  to view this content.
    would instead be

    Please Login or Register  to view this content.
    If that doesn't work you can show us the code.
    Last edited by scottiex; 02-21-2018 at 03:43 PM.

  6. #6
    Registered User
    Join Date
    04-04-2017
    Location
    LEMONT
    MS-Off Ver
    Office 13
    Posts
    50

    Re: Multiple macros for several files that change weekly - where to store macros

    Hi Scott,

    The is the code

    Sub MyNames()

    Range("A1").Select
    ActiveCell.FormulaR1C1 = "Jane"
    Range("A2").Select
    ActiveCell.FormulaR1C1 = "Timon"

    End Sub

    Kind regards,
    Jan

  7. #7
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    Re: Multiple macros for several files that change weekly - where to store macros

    if you want your macro code available to your use on other workbook what scottiex suggested use the personal.xlb
    go to visual basic editor--->project explorer
    right click PERSONAL.XLSB
    select insert module
    then paste all the code you want in there then save
    to use the macros on workbooks press ALT+F8
    it will list all the available macros
    select which macro you choses then click run

+ 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. Macros that work with multiple files?
    By husheric in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-11-2017, 11:36 PM
  2. Change parts of VBA macros in multiple XLS files in a folder?
    By Dumy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2012, 03:53 PM
  3. Macros for multiple files
    By reganfoust in forum Excel Programming / VBA / Macros
    Replies: 43
    Last Post: 02-09-2012, 05:53 PM
  4. Excel 2007 : Macros - multiple txt files to Excel
    By slj2531 in forum Excel General
    Replies: 0
    Last Post: 03-03-2011, 12:52 PM
  5. Excel 2007 : Applying macros to multiple files?
    By soultrain in forum Excel General
    Replies: 0
    Last Post: 12-06-2010, 06:57 PM
  6. Replies: 5
    Last Post: 02-17-2010, 02:02 PM
  7. Macros across multiple files
    By peterhine21 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-05-2006, 04:40 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