Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default autofilter, command to select filtered range?

Hello guys,

I apply a autofilter in my macro. It filters a range in column a with
criteria ="Y". Then I want to copy the lines in column a who fulfill
this criteria to a new sheet (also in column a)


what is the command for this?

thankx

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default autofilter, command to select filtered range?

I got this from Tom:

Sub CopyFilter()
'by Tom Ogilvy
Dim rng As Range
Dim rng2 As Range

With ActiveSheet.AutoFilter.Range
On Error Resume Next
Set rng2 = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _
.SpecialCells(xlCellTypeVisible)
On Error GoTo 0
End With
If rng2 Is Nothing Then
MsgBox "No data to copy"
Else
Worksheets("Sheet2").Cells.Clear
Set rng = ActiveSheet.AutoFilter.Range
rng.Offset(1, 0).Resize(rng.Rows.Count - 1).Copy _
Destination:=Worksheets("Sheet2").Range("A1")
End If
ActiveSheet.ShowAllData

End Sub

Mike F
"matthias" wrote in message
ups.com...
Hello guys,

I apply a autofilter in my macro. It filters a range in column a with
criteria ="Y". Then I want to copy the lines in column a who fulfill
this criteria to a new sheet (also in column a)


what is the command for this?

thankx



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
How do i view only the filtered results from autofilter ? Simon Excel Discussion (Misc queries) 3 August 16th 06 03:05 PM
keyboard command used to select a range of nonadjacent cells? Jessizzle123 Excel Discussion (Misc queries) 2 November 9th 05 09:19 PM
keyboard command used to select a range of nonadjacent cells? Ron Coderre Excel Discussion (Misc queries) 0 November 9th 05 07:16 PM
traversing through a filtered range based on another filtered range zestpt[_4_] Excel Programming 4 July 12th 04 06:37 PM
Selecting Filtered records only when AutoFilter is on Owen Vickers Excel Programming 4 February 21st 04 02:20 AM


All times are GMT +1. The time now is 01:03 AM.

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"