View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ND Pard ND Pard is offline
external usenet poster
 
Posts: 73
Default Autofilter Range

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

Go Back to your spreadsheet 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