RE: Autofilter Range

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Open your VBA editor (Alt & F11), insert a Module, copy and paste the macro
below.

Go Back to your spread*** and place your cursor in any of the Filtered
cells.

Run the macro (Alt & F8).

Good Luck.

Sub FilteredData_1st_n_Last_Rows()
Selection.CurrentRegion.Select
Range(ActiveCell.Offset(1), ActiveCell.Offset _
(Selection.Rows.Count - 1, Selection.Columns.Count - 1)).Select
Do While ActiveCell.Height = 0
ActiveCell.Offset(1).Select
Loop
MsgBox "First Row = " & ActiveCell.Row
Selection.CurrentRegion.Select
MsgBox "Last Row = " & Selection.SpecialCells(xlCellTypeLastCell).Row
End Sub

"Nigel" wrote:

Hi All
After I apply an autofilter, how can I determine the first visible row
number and last visible row number of the filtered list ?

Cheers

--

Regards,
Nigel
nigelnospam@xxxxxxxxx



.


Quantcast