+ Reply to Thread
Results 1 to 4 of 4

Fastest Find Last Used Row in Worksheet

  1. #1
    Forum Contributor
    Join Date
    07-23-2016
    Location
    Texas
    MS-Off Ver
    2016
    Posts
    274

    Fastest Find Last Used Row in Worksheet

    I have a spreadsheet with 5000 rows of data from column A to column E. To add a new entry, I need to find the last used row. Which is faster of the two below:
    i=1
    do while Activesheet.Range("A1").offset(i,0)<>vbnullstring
    i=i+1
    loop
    OR

    i=Activesheet.Cells(ActiveSheet.Rows.Count, "A").End(xlUp).Row

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Fastest Find Last Used Row in Worksheet

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    07-23-2016
    Location
    Texas
    MS-Off Ver
    2016
    Posts
    274

    Re: Fastest Find Last Used Row in Worksheet

    The ActiveSheet.rows.Count returns over 1m rows. I find it hard to believe that this is faster than using a loop to check for a blank cell within in 5000 rows. Maybe the following is faster:

    I=Activesheet.Cells(6000,"A").End(xlup).Row

  4. #4
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Fastest Find Last Used Row in Worksheet

    Takes only column A

    This one for entire sheet
    Please Login or Register  to view this content.
    Cheers
    Leo

+ 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] fastest way to deliver data to over 1000 worksheet from 1 worksheet
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-24-2015, 11:45 AM
  2. [SOLVED] Fastest way to find a duplicate value in two large columns
    By ArnolddG in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-28-2014, 05:05 AM
  3. [SOLVED] Fastest way to find item in an array.
    By WhytheQ in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-24-2006, 06:20 PM
  4. What is fastest for this? Small VBA or many worksheet formulas...?
    By Maria J-son in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-10-2005, 09:05 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