+ Reply to Thread
Results 1 to 9 of 9

Macro to extract data from different files

  1. #1
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Macro to extract data from different files

    Hi,

    I am looking for a macro to pull the data based on Date from the other files i.e Vijay.xls and Anand.xls
    Is it possible to entered the Date using input box? or Date can be entered on the cell and have the results pulled from other files below rows.

    Regards,
    Vijay
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Macro to extract data from different files

    Instead of a Macro, I think that an easier way to do this is run a couple of MS Query. MS Query comes installed in Excel. Here is a tutorial on how to use it.

    http://www.exceluser.com/explore/msquery1_1.htm
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Macro to extract data from different files

    Where do I get the MS Query?

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Macro to extract data from different files

    It is built into your excel program. In Excel 2003, it is on the Data--->Import External Data--->New Database Query.

  5. #5
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Macro to extract data from different files

    By this i'll have to create one by one Query to pull data from each file.

    I thought macro will be easy and could someone help me on that.

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Macro to extract data from different files

    You can use a macro to run the SQL statement. How many files will you be looking to grab data from? If only two, then you could modify your VBA to run one SQL statement and then the next.
    Please Login or Register  to view this content.
    The above is an example of a SQL statement that could be incorporated into your VBA. This was extracted directly from MS Query.

    Alan

  7. #7
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Macro to extract data from different files

    I'll be using from 10 different files and the date will be based on my input and not to be stable search.

  8. #8
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Macro to extract data from different files

    Could someone help me on this request

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Macro to extract data from different files

    Here's another solution since you didn't want to use MS Query.

    http://www.myonlinetraininghub.com/e...ultiple-sheets

+ 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