xlFilterCopy Help!!

G

Guest

I currently am working on a fairly large sheet where i want to extract/copy
data to another area using two different criterea. currently it seems to be
copying all the data. Any suggestions will be appreciated

Sub DataM()
Range("R1:Y2400").AdvancedFilter Action:=xlFilterCopy, CriteriaRange _
:=Range("AJ4:AK4"), CopyToRange:=Range("AG9:AN9"), Unique _
:=True
End Sub
 
G

Guest

Tom Thanks for your input. Yest the range for the criterea contains the
collumn headings and the specific data
--
Thanks,
VinceT


Tom Ogilvy said:
:=Range("AJ4:AK4"),

I would expect to be at least 4 cells.
 
T

Tom Ogilvy

Range("A1:A21").AdvancedFilter Action:=xlFilterCopy,
CriteriaRange:=Range( _
"D1:E2"), CopyToRange:=Range("G1"), Unique:=True

worked for me as an example. My criteria range is two rows. If you have
an OR condition, then it should have more rows.

But you can't have a criteria range with 1 row.

--
Regards,
Tom Ogilvy

VinceT said:
Tom Thanks for your input. Yest the range for the criterea contains the
collumn headings and the specific data
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top