+ Reply to Thread
Results 1 to 4 of 4

Batch copying Macro-enable Excel files with variations in VBA code

  1. #1
    Registered User
    Join Date
    12-22-2012
    Location
    Arkansas
    MS-Off Ver
    Excel 2010 & 2013
    Posts
    5

    Batch copying Macro-enable Excel files with variations in VBA code

    I need to batch copy 286 files, but the VBA code needs to be slightly different in each one. Here's an example of my code: Workbooks.Open ("\\directory\Reports\Ridership 2015 06 (Jun).xlsx") . The files where the code is located will be named with individual dates, such as "Reports 06-06-15". I am wanting to have a single template for my batch copy where Ridership YYYY MM (MMM).xlsx") references the originating file's name. Is there a way for me to make copies while changing the code from Ridership 2015 06 (Jun).xlsx") to Ridership 2015 07 (Jul).xlsx"),Ridership 2015 08 (Aug).xlsx"), and so on?

    I already know how to make a .bat to copy files, so please don't explain that process.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Batch copying Macro-enable Excel files with variations in VBA code

    Hi gbolsta,

    Welcome to the Forum!

    Here's a construction for you to adapt:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    12-22-2012
    Location
    Arkansas
    MS-Off Ver
    Excel 2010 & 2013
    Posts
    5

    Re: Batch copying Macro-enable Excel files with variations in VBA code

    Exactly what I needed.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Batch copying Macro-enable Excel files with variations in VBA code

    Glad I could help - and, thanks for the rep!

+ 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. Excel Macro from BATCH code issue
    By superdonk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-28-2014, 12:21 PM
  2. Replies: 1
    Last Post: 11-12-2013, 03:44 PM
  3. [SOLVED] Need help batch running an excel macro on .csv files and saving back to the same .csv
    By OutKlast in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-31-2013, 09:16 PM
  4. Batch Hyperlink Macro for PDF files
    By daelevans in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-25-2011, 05:46 AM
  5. Replies: 9
    Last Post: 05-29-2005, 02:05 AM

Tags for this Thread

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