+ Reply to Thread
Results 1 to 7 of 7

Find the absolute last used row - even when that row is hidden

  1. #1
    Forum Contributor
    Join Date
    10-30-2014
    Location
    England
    MS-Off Ver
    2007 / 365
    Posts
    281

    Find the absolute last used row - even when that row is hidden

    I am working on an import macro procedure where multiple external files are opened, a set range is copied, then the data is pasted to a master sheet.

    I was using .End(xlUp) to find the last used cell in column E to paste the next lot of data, but I notice it is thrown off if the master sheet is filtered and it returns the last used visible row.

    What is the best way to find the absolute last used row even when a sheet is in a filtered state?

    For example, if my sheet has 500 used rows, but a filter is in place and only 100 of them are showing, I still want the macro to be able to find that the last row is 500.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,994

    Re: Find the absolute last used row - even when that row is hidden

    If column E is fully populated, you could try using COUNTA. Or maybe create a Named Range for column E and use the row count. Or you could try making the data into Structured Table.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Find the absolute last used row - even when that row is hidden

    I don't remember ever using this ...

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Contributor
    Join Date
    10-30-2014
    Location
    England
    MS-Off Ver
    2007 / 365
    Posts
    281

    Re: Find the absolute last used row - even when that row is hidden

    Quote Originally Posted by TMS View Post
    If column E is fully populated, you could try using COUNTA. Or maybe create a Named Range for column E and use the row count. Or you could try making the data into Structured Table.
    Yeah I thought of that, and technically column E should always be populated down to the last row, hence why I was using it, but I have to allow for a user accidentally clearing a cell in that column and I really don't want to risk overwriting anything.

    Quote Originally Posted by shg View Post
    I don't remember ever using this ...

    Please Login or Register  to view this content.
    Well that seems to work in all 3 scenarios - with filtered rows, with no filtered rows and with no filter applied at all. I can only test it in 2007 at the moment, but it will need to work in 2013 and probably 2016 as well. Would there be any issues with the later versions of Excel as I know there are increased filter options in those?

    Is there a way of limiting this to a specific range of columns ?

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Find the absolute last used row - even when that row is hidden

    Quote Originally Posted by EchoPassenger View Post
    Is there a way of limiting this to a specific range of columns ?
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    10-30-2014
    Location
    England
    MS-Off Ver
    2007 / 365
    Posts
    281

    Re: Find the absolute last used row - even when that row is hidden

    Ah of course, sorry.

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Find the absolute last used row - even when that row is hidden

    You're welcome.

+ 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] find a name in a list instead of absolute reference
    By smls in forum Excel General
    Replies: 11
    Last Post: 07-26-2016, 12:31 PM
  2. [SOLVED] Help with INDEX MATCH to find absolute closest value
    By mave27 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 07-24-2015, 04:24 AM
  3. How to calculate errors (standard, Absolute or Absolute Relative)
    By rz6657 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-09-2015, 02:01 PM
  4. Replies: 0
    Last Post: 04-08-2013, 05:08 AM
  5. conditional formatting to find absolute value pairs
    By kisboros in forum Excel General
    Replies: 2
    Last Post: 01-04-2013, 02:51 AM
  6. Find smallest absolute value and row number with a macro
    By 77anders in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-12-2009, 05:24 AM
  7. how can I find out a total as a percentage using absolute cell
    By JoJo in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-15-2006, 09:55 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