+ Reply to Thread
Results 1 to 6 of 6

How to get data from many excels in one folder

  1. #1
    Registered User
    Join Date
    02-20-2016
    Location
    turkey
    MS-Off Ver
    MS Office2013
    Posts
    3

    How to get data from many excels in one folder

    Hello everyone,

    I'd like to ask you that: I want to write a macro within new excel sheet which looks a folder and get the specific range (H17:I17) from every excel sheets and orders me starting from B3 to the end.

    After the last row , I like to see the sum of them.

    For instance in my folder C:\Formular\Database\2016 there are 5 excel sheets whoose names are 3000 x,3500 y, 1250 z,1200 ab, 1250 ac . And my created excel name is overall. I want to get data from every excelsheets if its name starts with number.
    If folder name starts with number copy data from = Workbooks("3000 x").Sheets(“kapak”).Range(“H17:I17”)to Sheets("time").Cells(3, 2).Value

    How can I do that

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: How to get data from many excels in one folder

    ...get data from every excelsheets if its name starts with number.
    ...copy data from = Workbooks("3000 x").Sheets(“kapak”).Range
    Bit of a contradiction there - you possibly mean the folder name starts with a number but please clarify.
    Last edited by cytop; 04-28-2016 at 02:52 AM.

  3. #3
    Registered User
    Join Date
    02-20-2016
    Location
    turkey
    MS-Off Ver
    MS Office2013
    Posts
    3

    Re: How to get data from many excels in one folder

    1.PNG

    The concept of excels whose names start with numbers are same. And I'd like to get a specific range from these excel files to my targed excel file in order let's say starting from B3 to B32
    Last edited by asd1234asd; 04-28-2016 at 03:09 AM.

  4. #4
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: How to get data from many excels in one folder

    You still haven't explained - "data from every excelsheets if its name... "

    What does the 'its' refer to? The worksheet? The workbook? the directory? All 3?

    Sometimes, English can be a very vague language.

  5. #5
    Registered User
    Join Date
    02-20-2016
    Location
    turkey
    MS-Off Ver
    MS Office2013
    Posts
    3

    Re: How to get data from many excels in one folder

    Yes that's true and it's hard to explain the situation.

    In the folder there are lot's of workbooks but I'd like to just get data from excel if name of the workbook starts with any number, not the worksheet name. It needs to check on just the workbook name.

    To make it better, can we get workbook names also to the targed excel file for same situation if workbook name starts with number ?

    So with these order:
    -Checks workbooks (xls files) and if name of the workbook starts with number, macro gets the name of workbook to the target excel let's say to A3. Next to it paste the range that I have specified.
    Then the second excel whose workbook name starts with number ...etc

  6. #6
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: How to get data from many excels in one folder

    Add the following to a new module:
    Please Login or Register  to view this content.
    And call it using
    Please Login or Register  to view this content.
    You pass the directory, the range to extract and the sheet number. If the sheet number is 0 then information for all sheets will be copied, otherwise just the specified sheet (1, 2, 3...)

    The range and Sheet number parameters are optional. If you understand that, then fine, they can be ignored and it will default to H7:I7 and all sheets.

    This add a new workbook with the consolidated data starting in Row2. Col A will contain the workbook name and Col B onwards the data copied - I'll leave you to copy to your actual workbook and add the Totals. Easy enough to do manually, just a little longer with code but I don;t have a copy of your workbooks to verify the data first.
    Last edited by cytop; 04-28-2016 at 05:39 AM. Reason: Added Workbook name to Col A

+ 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. Is it possible to paste data to different excels through a macro?
    By vibhor in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-02-2015, 10:45 PM
  2. Copying Data Between Two Different Excels By Macro.
    By MoldyBread in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-28-2014, 11:27 PM
  3. pulling data from other excels , im new to vba :(
    By whoisgg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-15-2014, 04:03 PM
  4. VBA code to password protect all excels files in a folder
    By jaincool123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-03-2014, 07:19 AM
  5. [SOLVED] Copy Data from a specific tab of Multiple Excels into one excel
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-16-2013, 01:40 AM
  6. Macro to copy paste data from multiple excels into one sheet.
    By krash297 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-31-2013, 03:55 PM
  7. Replies: 0
    Last Post: 12-07-2010, 12:41 PM

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