ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Detecting Row number (https://www.excelbanter.com/excel-programming/369075-detecting-row-number.html)

jose luis

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


--
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


Die_Another_Day

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



JMB

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



jose luis

Detecting Row number
 

Thanks a lot "H", worked just fine.

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



All times are GMT +1. The time now is 02:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com