+ Reply to Thread
Results 1 to 3 of 3

Copying multiple sheets into one, and running out of rows

  1. #1
    Registered User
    Join Date
    07-22-2019
    Location
    Reading, England
    MS-Off Ver
    2016
    Posts
    4

    Copying multiple sheets into one, and running out of rows

    Hi Everyone,

    I have been coding for about 3 hours, so very inexperienced! Hopefully a wise owl will be able to help me here!

    I have a need to extract a couple of data points out of multiple files (approx. 150). I have only just begun coding but am happy on extracting the data from the source file and dropping it into the next available row of Col A of my master data. As I know I have 2.5 - 3 million lines....I know that one of my extractions will not fit as we reach the limit of excel. Once this is reached, I want it to start again in column E.

    I am assuming that I would use Activate.ActiveSheet.UsedRange.Rows.count to see if it fits and then to drop it in accordingly into col A, Col E (or Col I) but I'm a bit confused on how to do this


    I have a second problem - I have built this code up using a single file (milk1 !) but how do I get it to cycle through all the files in a single directory?

    Thanking you in advance for your help. I have attached my code

    MC
    Attached Files Attached Files

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,885

    Re: Copying multiple sheets into one, and running out of rows

    Personally I'd recommend switching from VBA to PowerQuery (Get & Transform) method.

    1. Query folder using, Get Data -> From File -> From Folder.
    2. Use binary combine menu to combine data (apply filter as needed).
    3. Load data to data model and check row# count.
    4. If it's too large to return data to worksheet, split them into multiple as needed using Table.Split function.
    https://docs.microsoft.com/en-us/pow...-m/table-split
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    07-22-2019
    Location
    Reading, England
    MS-Off Ver
    2016
    Posts
    4

    Re: Copying multiple sheets into one, and running out of rows

    ok 0 let me look at that too....

    Thanks

+ 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: 3
    Last Post: 07-18-2015, 02:06 PM
  2. [SOLVED] Copying Rows with Certain Criteria Met From and To Multiple Sheets
    By athompy in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-17-2015, 07:38 PM
  3. Need help with copying rows, replicating sheets, naming sheets and assigning print area...
    By Navin Agrawal in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-05-2014, 09:21 AM
  4. Replies: 0
    Last Post: 11-08-2012, 01:07 PM
  5. [SOLVED] VBA Code: Copying rows from multiple sheets
    By Nctukek in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-11-2012, 10:10 AM
  6. [SOLVED] Running a loop and copying and paste seperate rows offset by one
    By DannyJ in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-02-2012, 08:35 AM
  7. comparing and copying multiple rows on 2 sheets
    By Miranda82 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-18-2007, 04:01 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