Home |
Search |
Today's Posts |
#1
|
|||
|
|||
How do I choose the rows that are filtered ?
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 do How do I choose the rows that are filtered |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I choose the rows that are filtered ?
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 : 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 do How do I choose the rows that are filtered |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Is it possible to choose a certain amount of rows and have them ex | Excel Worksheet Functions | |||
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows | Excel Worksheet Functions | |||
Help!! I have problem deleting 2500 rows of filtered rows!!!! | Excel Discussion (Misc queries) | |||
Filtered Visible Rows & VBA Non-Filtered Rows Displayed | Excel Programming | |||
choose a cell anywhere and have filtered data appear there? Is there a way? | Excel Programming |