+ Reply to Thread
Results 1 to 6 of 6

Macro to collect data from multiple closed spread sheets.

  1. #1
    Registered User
    Join Date
    01-25-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Macro to collect data from multiple closed spread sheets.

    Hi,

    I'm a new member in this forum and I'm very new to macro/vba world. I would like to know how to create a macro to extract data from closed spread sheets.

    For example,

    I've spreadsheet on daily room temperature, weather, etc. Everyday a spread sheet with the daily data will be sent to me and I need to plot all the data so that I can analyze the collection of the data, day to day.

    Please if anyone can help me with this, as of now I've a lot of spreadsheets and it's quite ridiculous for me to open all the spreadsheets.

    Thank you.

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,525

    Re: Macro to collect data from multiple closed spread sheets.

    Are you talking about Sheets in the same Workbook or do you mean different Workbooks (files)

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

    Re: Macro to collect data from multiple closed spread sheets.

    Assuming all the spreadsheets are located in the same folder and nothing else is in there,

    1) Open your main workbook from where you would want to initiate this new process
    2) Turn on the macro recorder
    3) Record yourself opening one of your source spreadsheets, collect the data from it and paste into your main workbook, perhaps repeat with a second file
    4) Turn off the recorder.
    5) Paste the resulting code here in the forum along with your sample main workbook and the two source files you processed. We'll see if we can help automate that for you.

    Click GO ADVANCED and use the paperclip icon to post up a copy of your workbooks.
    _________________
    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!)

  4. #4
    Registered User
    Join Date
    01-25-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Macro to collect data from multiple closed spread sheets.

    Hi Jolivanes,

    The sheets are coming from different workbooks (diff excel files).

    Thank you.

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,525

    Re: Macro to collect data from multiple closed spread sheets.

    The way JBeaucaire described is the best way to learn
    In the meantime you could try this.

    Have all the workbooks in the same Folder including the Workbook that has this code in it.
    No other Workbooks in this Folder.
    The Range to be copied is set at A1:B15. Change to suit.

    Try it with copies of all workbooks in a temporary Folder first.




    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-25-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Macro to collect data from multiple closed spread sheets.

    Hi JBeaucaire & Jolivanes..

    Thanks..I'll try to do it based on your advice..I'll you know the result later since I need sometime to 'digest' and execute..

    Thanks again..

+ 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