+ Reply to Thread
Results 1 to 4 of 4

Loop through files in a folder and copy 2 rows from each file(xlsx) in a master file(xlsx)

  1. #1
    Registered User
    Join Date
    12-26-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    10

    Loop through files in a folder and copy 2 rows from each file(xlsx) in a master file(xlsx)

    I want to loop through a folder containing xlsx workbooks, all names beginning with 'op', from these files, copy rows in sheet2, rows are "a10 to q10" & "a15 to q15" in a master xlsx file. first row should get appended in sheet1 named 'nf' & second row should get appended in sheet2 named 'bnknf' in the master file named "Summary".

    Thanks.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Loop through files in a folder and copy 2 rows from each file(xlsx) in a master file(x

    Try adding this code to the Summary Workbook.

    Please Login or Register  to view this content.
    Open up the VBA editor by hitting ALT F11

    Insert a new module by hitting Insert - Module

    Paste the macro into the empty sheet

    Hit ALT F11 to get back to the worksheet.

    Run the macro by going to tools-macro in Excel 2003 or the view ribbon in Excel 2007/2010.
    Martin

  3. #3
    Registered User
    Join Date
    12-26-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Loop through files in a folder and copy 2 rows from each file(xlsx) in a master file(x

    Thank u so much Martin. It worked perfectly.
    :-)
    Shailesh

  4. #4
    Registered User
    Join Date
    12-26-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Loop through files in a folder and copy 2 rows from each file(xlsx) in a master file(x

    Thank u so much Martin. It worked perfectly.
    :-)
    Shailesh

+ 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. Replies: 1
    Last Post: 12-10-2013, 12:11 PM
  2. Replies: 0
    Last Post: 03-13-2013, 09:08 PM
  3. Loop to copy the same rows from multiple files to a master file
    By allen123 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-29-2012, 09:15 PM
  4. How to add the columns data of several xlsx files of a folder in another xlsx file
    By ravikumar00008 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-25-2012, 04:29 AM
  5. Replies: 1
    Last Post: 12-21-2011, 11:00 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