+ Reply to Thread
Results 1 to 4 of 4

Copy VBA from Workbook_Open() into multiple others in a directory

  1. #1
    Registered User
    Join Date
    09-20-2012
    Location
    uttoxeter
    MS-Off Ver
    Excel 2010
    Posts
    8

    Copy VBA from Workbook_Open() into multiple others in a directory

    Hi

    Is it possible to copy all the VBA code from one 'ThisWorkbook' Workbook_Open() sub into multiple other xlsx files in a directory.

    i have a sub that runs on Workbook_Open() of a master quote xlsx file that i have fine tuned since working from home recently. It opens a background xlsx file & updates the links (location of the background price xlsx file) if necessary.
    Now i have it pretty much how i want it i want to be able to copy all this code & paste into the corresponding Workbook_Open() of multiple xlsx files in a directory.

    Thanks in advance for any help.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Copy VBA from Workbook_Open() into multiple others in a directory

    Administrative note

    Still using XL2003 as indicated in your profile?
    If not,perhaps update your profile as necessary to properly reflect the exact version(s) of Excel your question relates to? Members tailor answers based on your Excel version.
    Thanks

  3. #3
    Registered User
    Join Date
    09-20-2012
    Location
    uttoxeter
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Copy VBA from Workbook_Open() into multiple others in a directory

    sorted - thanks for that.

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Copy VBA from Workbook_Open() into multiple others in a directory

    Hi shenty,

    Workbook_Open() of multiple xlsx
    .xlsx files are not allowed to have Macros. If you have .xlsm files or want to save .xlsx files as .xlsm it can be done, but it is not trivial.

    Chip Pearson had graciously shared VBE secrets with us at before his untimely passing. http://www.cpearson.com/excel/vbe.aspx

    To get started, you have to follow the instructions at the top of the URL explicitly, or you will get compile and/or runtime errors.

    Good luck.

    Lewis

+ 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] macro to copy excel files only from main directory and sub directory to a specific folder
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-05-2019, 09:49 AM
  2. Check multiple criteria Workbook_Open event
    By 323428 in forum Excel Programming / VBA / Macros
    Replies: 29
    Last Post: 08-01-2017, 02:24 PM
  3. Open multiple workbooks in directory, copy a range to them for data collection
    By agutman50 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-28-2014, 01:24 PM
  4. Private sub workbook_open code running workbook_open code from other project
    By marshall_massive in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-20-2013, 06:07 PM
  5. Combine multiple Subs into Workbook_Open Sub
    By rlsublime in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-20-2012, 02:35 PM
  6. call multiple macros in workbook_open?
    By slimswol in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-09-2006, 11:29 PM
  7. [SOLVED] Workbook_Open - Multiple Events not all working
    By Punsterr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-06-2005, 03:05 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