+ Reply to Thread
Results 1 to 2 of 2

VBA Macro to open / close multiple Workbooks

  1. #1
    Registered User
    Join Date
    03-05-2015
    Location
    Portugal
    MS-Off Ver
    Portugal
    Posts
    24

    Question VBA Macro to open / close multiple Workbooks

    Good night,

    I was wondering if there's a way to make a VBA macro to open some workbooks in a certain directory (the same where the workbook with the macro will be) in some user defined order. Lets make an example:

    MacroWorkbook.xlsx

    WorkbookDataCollection.xlsx

    Temperature1.xlsx | Temperature2.xlsx .... TemperatureN.xlsx
    Flow1.xlsx | Flow2.xlsx .... FlowN.xlsx

    I have WorkbookDataCollection.xlsx collecting all data from the different Temperature and Flow data sheets, but since it only collect if they are opened I need a macro to open them all (The N stands for different amount of data workbooks) and after they are all opened to close them.. Lets say I have two of each, the process will be:

    OPEN:
    Temperature1.xlsx | Temperature2.xlsx | Flow1.xlsx | Flow2.xlsx -----> WorkbookDataCollection.xlsx

    CLOSE:
    Temperature1.xlsx | Temperature2.xlsx | Flow1.xlsx | Flow2.xlsx | WorkbookDataCollection.xlsx

    Given there are random number of data workbooks, I think I would need some sort of loop.

    Thanks in advance
    Odracir

  2. #2
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: VBA Macro to open / close multiple Workbooks

    Hi,

    something like this

    Please Login or Register  to view this content.
    If you are pleased with a member's answer then use the Star icon to rate it.

+ 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. Open and close multiple workbooks - out of memory
    By Per Olander in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-25-2014, 11:21 AM
  2. open, close multiple workbooks on sharepoint
    By ChocksterNo1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-23-2014, 07:09 AM
  3. [SOLVED] Macro to close all open workbooks except one
    By aetedford in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-26-2013, 10:21 AM
  4. [SOLVED] Open Multiple Workbooks, Record names, Copy paste to Active Workbook, Close the Workbooks
    By vba_madness in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-24-2013, 06:09 AM
  5. Macro to close all open workbooks save two not working
    By drajanm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-18-2011, 05:58 AM
  6. macro to open and close Excel workbooks
    By norman0000 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-12-2010, 12:26 PM
  7. Macro to open and close other workbooks
    By nms2130 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-03-2008, 10:28 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