+ Reply to Thread
Results 1 to 6 of 6

Loop Copy and paste multiple ranges from multiple workbooks

  1. #1
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    Loop Copy and paste multiple ranges from multiple workbooks

    Hi All,

    I have a macro that is looping through all workbooks in a folder to collate certain data into a master workbook.

    What I am finding though is that when the macro loops to the next workbook it is pasting not at the bottom of the last workbooks data but only under the first row of 19 rows.


    I have attached the workbook (macro is called January), code below.

    Please Login or Register  to view this content.
    How do I make it paste to the bottom each time?

    Thanks,
    Brendan

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Loop Copy and paste multiple ranges from multiple workbooks

    Hi Brendan- just add 19 to lrow each pass instead of 1.
    Please Login or Register  to view this content.
    Last edited by leelnich; 12-18-2017 at 09:08 AM.
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

  3. #3
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: Loop Copy and paste multiple ranges from multiple workbooks

    Hi leelnich,

    thanks for the reply. Just tried this and all it did was add a 19 row gap between the pasted data and the existing data:

    Capture.JPG

  4. #4
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Loop Copy and paste multiple ranges from multiple workbooks

    Perhaps try re-calculating lrow each pass:
    Please Login or Register  to view this content.
    Don't forget to remove the other lrow adjustment.

  5. #5
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: Loop Copy and paste multiple ranges from multiple workbooks

    Thanks again,

    Sorry but I am not really too savvy with vba and just copied this code so I am not sure how to do what you said. I have place it like this but am getting an error:



    Please Login or Register  to view this content.

  6. #6
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Loop Copy and paste multiple ranges from multiple workbooks

    Try this:
    Please Login or Register  to view this content.
    Notice I renamed the procedure so you can paste it in the same module without conflict. Obviously, I couldn't test it. Let me know if it works.
    Last edited by leelnich; 12-18-2017 at 06:58 PM.

+ 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. Excel VBA Loop Macro - Copy Different Ranges and Paste into Multiple Workbooks
    By Hoover5896 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-20-2017, 08:47 PM
  2. Copy Paste Values from multiple workbooks to multiple sheets in one workbook
    By tatendamark in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-12-2017, 09:54 AM
  3. [SOLVED] Open Multiple Workbooks, Record names, Copy paste to Active Workbook, Close the Workbooks
    By vba_madness in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-24-2013, 06:09 AM
  4. Copy / Paste multiple loop results in specific column ranges on one worksheet
    By bfbisso in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-24-2012, 01:11 PM
  5. To Copy ranges from multiple workbooks to one sheet
    By psmcltraining in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-19-2009, 05:25 AM
  6. loop to copy data from multiple workbooks into one
    By staffordalex in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-05-2008, 01:13 PM
  7. copy dynamic ranges in multiple workbooks based on a data in 1 col
    By jbsand1001 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-18-2005, 03:06 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