+ Reply to Thread
Results 1 to 2 of 2

Bypass Clipboard when copy/pasting non-contiguous rows

  1. #1
    Registered User
    Join Date
    10-04-2012
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    18

    Bypass Clipboard when copy/pasting non-contiguous rows

    Hello Everyone-

    I think a pretty common thing to do with vba is to autofilter some range, and then copy/paste the visible cells to another range. I've got that down, and that is currently what I'm doing. The problem is that my data set can grow to 400k+ rows of data with 40 columns, and using the clipboard to perform this task, while quick enough, takes huge amounts of memory. The code stops running with an "out of memory" error and I dont know of a way to clear the memory in between steps. So, is there a way to do this by bypassing the clipboard all together?

    Here is a sample snippet of code that comes close to what I'm trying to do, but only moves over the first block of contiguous rows, and gives me #N/A's for the rest. Is there a way to do this?

    As always, thanks in advance for any help!!

    P.S. - this would assume that the user has set the autofilter on their own.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Bypass Clipboard when copy/pasting non-contiguous rows

    I ran into a very similar issue on my last big project, which was 294k rows by 44 Columns.

    Ultimately, my workaround was to run a For Each loop and copy the entire row of each that met my filtering criteria to the next row of another tab.


    Here's the piece of code with the copy loop/filter:

    Please Login or Register  to view this content.
    My automated filter pulled latitude/longitude cells of each row, compared it to another sheet using some fancy trigometry to calculate distance, made sure a few column contained some values and didn't include others, and then copied the row over. Running the full trig macro on every line takes me about 22 seconds.


    We use this as a tool now to query datasets for our analysts to build all kinds of studies, usually depending on each record being within x miles of a point.

    Would this kind of process help you?
    Last edited by daffodil11; 03-21-2014 at 03:14 PM.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

+ 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. [SOLVED] clipboard bypass not working
    By rossg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-24-2013, 06:01 PM
  2. [SOLVED] How to delete multiple contiguous (and/or) non-contiguous rows, in an excel table
    By jimmalk in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-03-2012, 05:48 AM
  3. Replies: 2
    Last Post: 11-04-2012, 12:18 AM
  4. Copy and Paste an array (contiguous & non contiguous ranges)
    By Xrull in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-09-2010, 09:17 AM
  5. bypass clipboard too large comment
    By tdyl1969 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-18-2009, 09:49 AM

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