Code Snippet - Data Filter
hi Tim,
Sub Filter_Row()
Dim plg As Range, X As Variant, x1 As String, x2 As Variant, xx As String
Set plg =
ActiveSheet.Range("_filterdatabase").SpecialCells( xlCellTypeVisible)
S = Split(plg.Address, ",")
If UBound(S) = 0 Then
x1 = Range(Cells(Range(S(0)).Row + 1,
Range(S(0)).Column).Address).Row ' first row
x2 = Split(S(0), ":")
xx = Range(x2(UBound(x2))).Row ' last row
Else
x1 = Range(S(1)).Row ' first row
xx = Range(S(UBound(S))).Row ' last row
End If
End Sub
isabelle
Le 2013-02-23 05:29, Tim Childs a écrit :
Hi
If there is a worksheet with a table of data and other data beneath
that, is there a property associated with the Data Filter method that
will return the last row included in the filtered data i.e. the last row
in scope of the filtering, so it is not dependent on the current
criteria set, just on the basis of where the filter is including as
being in scope. For the avoidance of doubt, it is the last row the user
included when the filter area was created initially.
Many thanks
Tim
|