Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to choose a certain amount of rows and have them ex ocean Excel Worksheet Functions 6 July 22nd 09 02:32 AM
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows Scott Excel Worksheet Functions 0 December 13th 06 01:25 AM
Help!! I have problem deleting 2500 rows of filtered rows!!!! shirley_kee Excel Discussion (Misc queries) 1 January 12th 06 03:24 AM
Filtered Visible Rows & VBA Non-Filtered Rows Displayed QTE[_15_] Excel Programming 8 July 11th 04 02:21 AM
choose a cell anywhere and have filtered data appear there? Is there a way? Cheryl[_2_] Excel Programming 2 May 19th 04 12:41 PM


All times are GMT +1. The time now is 12:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"