+ Reply to Thread
Results 1 to 2 of 2

VBA loop through all workbooks in folder copy data into new summary tab

  1. #1
    Registered User
    Join Date
    01-07-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    14

    VBA loop through all workbooks in folder copy data into new summary tab

    I have hashed together pieces of code to pull out a row of data from all worksheets in a folder based on a certain period (this part is manually entered via a message box) next I need to insert a new tab named summary into each workbook and then paste the row of data into it. I am able to do this in part but it is only working when I insert the macro into each workbook, but I need the code to be generic and loop through all closed workbooks in a folder. I have put below my very badly written code which has a lot of duplication but I don't know how to cleanse this without mucking it up and cannot make it work for all closed workbooks, the issue is I think relating to the used.range part but not really sure. Can anyone please help me complete this, I have attached a sample report with tan example of the summary tab required.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Beany213; 06-11-2013 at 05:39 AM.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA loop through all workbooks in folder copy data into new summary tab

    Beany,
    You are working on the same active sheet. You need to loop through a folder using a dir. Ron Deburin website has lots of stuff on merging.
    http://www.rondebruin.nl/win/addins/rdbmerge.htm

+ 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