+ Reply to Thread
Results 1 to 4 of 4

Find Last Row Containing Data (DO NOT count blank rows at the end)

  1. #1
    Registered User
    Join Date
    03-23-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    50

    Find Last Row Containing Data (DO NOT count blank rows at the end)

    This is by far the most infuriating issue I've run into guys.

    I have 200 workbooks that I need to open and copy data from (pasting into one destination workbook). To do this, I am trying to determine the last row of data in each workbook during the copy & paste procedure. However Excel is arbitrarily adding blank rows at the end of the data into the count.

    For example, the first workbook has 23 rows of data. Excel determines that the last row of data is row # 23. It copies this, then pastes it into the destination workbook. In the destination work book, when I try to add formulas in the last column of the data I tell it to run a formula and fill down to the last row of data in the destination sheet. Now clearly, there are only 23 rows but Excel is pasting the formula down to row 65.

    I have searched through two pages of Google search results and the search function for this forum is returning zero threads. The current code I've tried most recently is as follows:

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Thank you all in advance!
    Last edited by ryanmorris; 06-21-2012 at 01:18 PM. Reason: spelling

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Find Last Row Containing Data (DO NOT count blank rows at the end)

    Why not the good old fashion,

    Please Login or Register  to view this content.
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Registered User
    Join Date
    03-23-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Find Last Row Containing Data (DO NOT count blank rows at the end)

    Thanks JapanDave, still having the same problems though.

  4. #4
    Registered User
    Join Date
    03-23-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Find Last Row Containing Data (DO NOT count blank rows at the end)

    Okay, so I finally fixed it with the help of a colleague. I've included my code so that it can help anyone going forward. JapanDave, I did change my counting lines to the ones you suggested so thank you again.

    Please Login or Register  to view this content.

+ 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