How do I choose the rows that are filtered ?

C

cupertino

Here is part of my macro

'' Formatting Alan with color
Range("A1").Select
Application.CutCopyMode = False
ActiveWindow.DisplayGridlines = False
Selection.AutoFilter Field:=1, Criteria1:="Alan"
Selection.AutoFilter Field:=3, Criteria1:="=Alan"

''''''''''' >>>>>>>>>>>>>>>>>>>>>>>>>>>> why is the next line A2 ?
Range("A2").Select

''''''''''' >>>>>>>>>>>>>>>>>>>>>>>>>>>> Above line could be A20, how d
How do I choose the rows that are filtere
 
I

isabelle

hi cupertino,

Sub Filtered_Data1()
'this example lists the data and addresses of the first (1) column of the filter

Dim S As Variant
Dim plg As Range, rng As Range, c As Range
Dim i As Integer, FirstAdd As String, LastAdd As String
Set plg = ActiveSheet.Range("_filterdatabase").SpecialCells(xlCellTypeVisible)

S = Split(plg.Address, ",")

For i = 0 To UBound(S)
For Each rng In Range(S(i)).Columns(1) 'adapt the "th" column
For Each c In Range(rng.Address)
If c.Address <> ActiveSheet.Range("_filterdatabase")(1).Address Then 'adapt the "th" column
FirstAdd = c.Address
GoTo fin
End If
Next
Next
Next

fin:
LastAdd = Range(S(UBound(S))).Columns(1).Address
Range(FirstAdd & ":" & LastAdd).Select
End Sub


--
isabelle



Le 2012-02-15 19:08, cupertino a écrit :
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top