+ Reply to Thread
Results 1 to 2 of 2

Copy range without blank rows

  1. #1
    Forum Contributor
    Join Date
    01-12-2004
    Location
    Nebraska, USA
    MS-Off Ver
    Office 365
    Posts
    167

    Copy range without blank rows

    I tried searching the forum for information. Kept getting an error message.

    Fatal error: Allowed memory size of 100663296 bytes exhausted (tried to allocate 71 bytes) in /home/eforum/public_html/search.php on line 1155

    Here's my problem:

    I need to take data from a range...(O2:R200...in this case), and transfer it to another range...(U2:X200).
    The problem is that Range(O2:R200) has two or more blank rows at the top of the data.
    I need the data in this range transfered to range U2:X200 starting with the first row of NONBLANK cells.
    Here is the VBA I've have tried to achieve this:
    Please Login or Register  to view this content.
    My problem is that THIS line of the code:
    Please Login or Register  to view this content.
    ...which is designed to shift the data up by deleting BLANK cells.....works, but not completely.
    The data is shifted perfectly...but I get a bunch of #NA errors for many rows beneath the shifted data.

    I have a dynamic named range named Saturday_Only produced with the following code:
    Please Login or Register  to view this content.
    This named range is the RowSource for a ListBox in a UserForm.
    So...as you can guess...my list box shows every one of the #NA errors.

    How do I fix this??

    (Sample worksheet attached) --- Worksheet REMOVED by HuskerBronco (See next post)
    Last edited by HuskerBronco; 08-14-2010 at 01:41 PM. Reason: Mark SOLVED and remove attachment

  2. #2
    Forum Contributor
    Join Date
    01-12-2004
    Location
    Nebraska, USA
    MS-Off Ver
    Office 365
    Posts
    167

    Re: Copy range without blank rows

    Well, guys...

    I was sure stumped as to why the code referenced above wasn't working.
    I figured out why.......because, that wasn't even the code I had in my Subroutine, at all.

    I apparently had a NamedRange where I should have had ("O2:R200")...
    And that NamedRange carried WAY below my data set...hence all of the #NA errors.

    I suppose I'll put on my dunce cap and go sit in the corner...!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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