Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do i view only the filtered results from autofilter ? | Excel Discussion (Misc queries) | |||
keyboard command used to select a range of nonadjacent cells? | Excel Discussion (Misc queries) | |||
keyboard command used to select a range of nonadjacent cells? | Excel Discussion (Misc queries) | |||
traversing through a filtered range based on another filtered range | Excel Programming | |||
Selecting Filtered records only when AutoFilter is on | Excel Programming |