Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

advanced filter in excel vba 1

Status
Not open for further replies.

xq

Programmer
Jun 26, 2002
106
0
0
NL
i was trying to copy all the unique items from a range to another range, but code 'xlFilterCopy' the advanced filter action i specified doesn't work. anybody has a clue, thanks million!

FindUniqueVal Range("A2:A100"), Range("C1")

Sub FindUniqueVal(SourceRange As Range, TargetCell As Range)
SourceRange.AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=TargetCell, Unique:=True
End Sub

 
Could you describe the problem?

Are you saying this procedure doesn't get unique results, or that it gets an error message?

Tom
 
thanks, actually it produced nothing, there's nothing in the column C and i didnt' get any error message. i went to the toolbar data->filter>advanced filter after i ran that macro, i saw the 'list range' and 'copy to' range has been set up as i wrote in the code. except the action is not on the 'copy to another location' and the box of 'unique records only' is not ticked. and i've checked code, there is nothing wrong with that. did i miss something in the code?
 
xq,

If you'd like, I can email you example files that will demonstrate how to achieve a "variety" of different tasks using Excel's "Advanced Filter" functions. This will include the task you describe.

Regards, ...Dale Watson

HOME: nd.watson@shaw.ca
 
that would be great if u could send me the file. i send u mail right now. thank u!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top