View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
michdenis michdenis is offline
external usenet poster
 
Posts: 135
Default Find first row number after filtering

Hi Steven,

Try this :

'---------------------------------
Sub First_Row()
On Error Resume Next
With ActiveSheet
If .AutoFilterMode = True Then
With .Range("_FilterDatabase")
MsgBox .Offset(1).Resize(.Rows.Count - 1, _
Columns.Count).SpecialCells(xlCellTypeVisible).Row
End With
End If
End With
End Sub
'---------------------------------


"StevenM" a écrit dans le message de groupe de
discussion : ...
I set up an autofilter and select the rows that have a blank value in the
column. that's fine. I want to go to the first selected row. When I record
a macro to go to the heading row and then arrow down once, the macro records
the actual row I end up in (A37 in this case). But I need to set a variable
as the next time I run (on a different file) it won't necessarily be A37.
How do I find the row number of the first row after the header row in an
autofiltered spreadsheet?

Appreciate any light you can shed. thanks in advance,
StevenM