View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Macro to filter sheet and copy to another

Sub CopyData()
With Worksheets("sheet4")
.Range("A1").AutoFilter Field:=20, Criteria1:="Amended"
Set rng = .AutoFilter.Range
Set rng = rng.Offset(1, 0).Resize(rng.Rows.Count - 1)
Set rng1 = Intersect(rng, .Range("A:C,G:M,Q:S"))
rng1.Copy _
Destination:=Worksheets("Sheet2").Range("A1")
End With
End Sub


--
Regards,
Tom Ogilvy


"Gareth" wrote in message
...
I want to used AutoFilter to filter column T on Sheet1 for the word
'Amended'.

If there are any found, I would like to copy only certain columns to

Sheet2.

The columns are A:C, G:M, Q:S

Thanks in advance.

Gareth