+ Reply to Thread
Results 1 to 4 of 4

Detecting Row number

Hybrid View

  1. #1
    Registered User
    Join Date
    08-18-2004
    Posts
    97

    Unhappy Detecting Row number

    Hello

    I want to detect the number of the row that shows the last data after after filtering a table. Let me explain, I have a table with autofilter on, and after filtering one column using any criterion, i want to know the Row number of the last data remaining. I hope it's clear enough to you in order to suggest me some ideas.

    Thanks in advance

    Regards

    Jose Luis

  2. #2
    Die_Another_Day
    Guest

    Re: Detecting Row number

    Off the top of my head there are 2 ways.
    1. if there is nothing beneath your autofiltered data
    LastVisibleRow = Range("A" & Rows.Count).End(xlUp).Row

    2. If there is something beneath autofilter and Column "A" or any other
    Column that you specify has data in every row, down to the last row.
    LastVisibleRow = Range("A1").End(xlDown).Row

    HTH

    Die_Another_Day

    jose luis wrote:
    > Hello
    >
    > I want to detect the number of the row that shows the last data after
    > after filtering a table. Let me explain, I have a table with autofilter
    > on, and after filtering one column using any criterion, i want to know
    > the Row number of the last data remaining. I hope it's clear enough to
    > you in order to suggest me some ideas.
    >
    > Thanks in advance
    >
    > Regards
    >
    > Jose Luis
    >
    >
    > --
    > jose luis
    > ------------------------------------------------------------------------
    > jose luis's Profile: http://www.excelforum.com/member.php...o&userid=13312
    > View this thread: http://www.excelforum.com/showthread...hreadid=567301



  3. #3
    Registered User
    Join Date
    08-18-2004
    Posts
    97
    Thanks a lot "H", worked just fine.

    Regards

    Jose Luis

  4. #4
    JMB
    Guest

    RE: Detecting Row number

    A little longer, but seemed to work. Worksheet reference would have to be
    changed.

    Sub test()
    With Worksheets("Sheet2")
    With Intersect(.AutoFilter.Range, _
    .Cells.SpecialCells(xlCellTypeVisible))
    With .Areas(.Areas.Count)
    MsgBox .Rows(.Rows.Count).Row
    End With
    End With
    End With
    End Sub


    "jose luis" wrote:

    >
    > Hello
    >
    > I want to detect the number of the row that shows the last data after
    > after filtering a table. Let me explain, I have a table with autofilter
    > on, and after filtering one column using any criterion, i want to know
    > the Row number of the last data remaining. I hope it's clear enough to
    > you in order to suggest me some ideas.
    >
    > Thanks in advance
    >
    > Regards
    >
    > Jose Luis
    >
    >
    > --
    > jose luis
    > ------------------------------------------------------------------------
    > jose luis's Profile: http://www.excelforum.com/member.php...o&userid=13312
    > View this thread: http://www.excelforum.com/showthread...hreadid=567301
    >
    >


+ 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