+ Reply to Thread
Results 1 to 6 of 6

Copy Values From Each Workbook in Folder to a Single Sheet in New Workbook +Workbook names

  1. #1
    Registered User
    Join Date
    07-31-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2007
    Posts
    7

    Copy Values From Each Workbook in Folder to a Single Sheet in New Workbook +Workbook names

    Hello

    I found this code (Copy All Sheets From Each Workbook in Folder to a Single Sheet in New Workbook) and I'd like to use it to get monthly reports through several daily reports.


    Can someone help me to modify this code so that it shows the name of the workbook that the data has been derived from in a separate coloumn (r.g. column Z)?

    Also, the current code pastes the formulas and values, but I just need the values of the formulas not the actual formulas.

    And finally, I don't need the entire pages I just want to copy the cells A1:Y20 of each workbook.

    Thanks,
    Please Login or Register  to view this content.
    Last edited by Cutter; 09-21-2012 at 09:59 PM. Reason: Replaced QUOTE tags with CODE tags

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Copy Values From Each Workbook in Folder to a Single Sheet in New Workbook +Workbook n

    Untested but give this a try

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Registered User
    Join Date
    07-31-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Copy Values From Each Workbook in Folder to a Single Sheet in New Workbook +Workbook n

    Thanks Mike.
    I tried the code; for all the workbooks (except the first or last one) it pastes only the first 2 raws. And I need the workbook name not the worksheet name.

  4. #4
    Registered User
    Join Date
    07-31-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Copy Values From Each Workbook in Folder to a Single Sheet in New Workbook +Workbook n

    I changed:
    PHP Code: 
                        .Cells(LR"z").Resize(UBound(a)) = ws.Name 
    to
    PHP Code: 
                        .Cells(LR"z").Resize(UBound(a)) = FileName.Name 
    and it works fine.
    But still only first 2 raws of the workbooks are pasted.

  5. #5
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Copy Values From Each Workbook in Folder to a Single Sheet in New Workbook +Workbook n

    This works for me

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    07-31-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Copy Values From Each Workbook in Folder to a Single Sheet in New Workbook +Workbook n

    THANK YOU.
    I tried it with different test files and it worked fine.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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