View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
isabelle isabelle is offline
external usenet poster
 
Posts: 587
Default Code Snippet - Data Filter

correction,

Sub Filter_first_last()
Dim plg As Range, x As Variant, pr As String, dr As String
Set plg =
ActiveSheet.Range("_filterdatabase").SpecialCells( xlCellTypeVisible)
x = Split(plg.Address, ",")
If Range(x(0)).Rows.Count 1 Then
pr = Range(x(0)).Rows(2).Row 'first row
dr = Range(x(UBound(x))).Row 'last row
Else
pr = Range(x(1)).Row 'first row
dr = Range(x(UBound(x))).Row 'last row
End If
MsgBox "Fisrt: " & pr & " Last: " & dr
End Sub


isabelle