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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
|