+ Reply to Thread
Results 1 to 7 of 7

Copy Non-Blank Cells to Another Worksheet

  1. #1
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Copy Non-Blank Cells to Another Worksheet

    My worksheet has thousands of rows but in Column A there are only a few dozen entries; most Column A cells are blank. The goal is to copy and paste the populated cells to another worksheet. What is the fastest way? I tried sorting first but that seems unbearably slow. Also, is it better to copy the cells into a variable or array and then paste them to the new worksheet or find each one and paste individually.

    Thanks!

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Copy Non-Blank Cells to Another Worksheet

    Maybe:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Re: Copy Non-Blank Cells to Another Worksheet

    Hi John,

    Thanks for the quick suggestion!

    This line had an error...

    Please Login or Register  to view this content.
    "AutoFilter method of Range class failed"

    Could this have anything to do with the fact that my worksheets are tables (ListObjects)?

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

    Re: Copy Non-Blank Cells to Another Worksheet

    Tom,
    Yes, if you have a table, the filter should apply to the list objects.

  5. #5
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Re: Copy Non-Blank Cells to Another Worksheet

    Understood. But I am getting that error whether filtering was on or off before execution. What needs to be changed in the code? Also, John, I only need to copy the filtered contents of Column A, not the row. Thanks.

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Copy Non-Blank Cells to Another Worksheet

    I'm not sure of what may be causing the error. Can you post a sample file with some data? If you just wanted the contents of Column A then this should work.

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Re: Copy Non-Blank Cells to Another Worksheet

    Hi John,

    I have not bothered yet to test your code again. You asked for a sample worksheet so I have developed that instead. The actual job is a bit bigger than my original request. we are extracting data from three worksheets instead of just one. The sample shows the entire job. It also has an Info worksheet that explains in detail what is needed.

    Thanks for your post. I hope you will find my sample adequate.

    Thanks again for your help.

    tom
    Attached Files Attached Files

+ 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] Auto insert blank row. (blank copy of row that includes merged cells)
    By rutts in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-22-2013, 07:48 PM
  2. [SOLVED] Macro to find blank cells, copy row, paste into another worksheet, then delete
    By rbrookov in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-15-2013, 01:39 PM
  3. [SOLVED] vba to copy non blank cells and paste to other worksheet
    By tantcu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-18-2013, 06:22 PM
  4. Copy certain cells from one worksheet to another worksheet with blank rows
    By pmarsella in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-06-2009, 07:57 AM
  5. Copy non blank cells to another worksheet
    By JD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2006, 09:25 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