+ Reply to Thread
Results 1 to 2 of 2

Data Consolodation VBA - close inactive workbook

Hybrid View

  1. #1
    Registered User
    Join Date
    11-06-2009
    Location
    Belfast, N Ireland
    MS-Off Ver
    Excel 2003
    Posts
    3

    Data Consolodation VBA - close inactive workbook

    Hi

    I am working on an excel spreadsheet which is consolodating data from another workbook. Lets call the one with the consolodation the 'master'. I have a macro which is working to consolodate data from a different workbook called the 'local'. The local workbook has multiple worksheets, all with the same column format and data entry. The purpose of the master is to consolodate all the data from all local worksheets into one worksheet in the master and my macros is working to do this very well.

    To run the macro from the master, the local must not be open. But when I run it, the macro opens the local so that it can copy the cell ranges in each worksheet etc, however when the macro finishes and the consolodation is completed, the local workbook is still open.

    Is there a piece of VBA code I can write at the end of the macro which will close the local workbook and only leave the master as the only open workbook? Basically so my open files are as they were before I ran the macro.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Data Consolodation VBA - close inactive workbook

    Yes, indeed. If you post your macro code, it will probably be clearer to us which code corrections to suggest. Be sure to put code tags around the pasted code.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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