I'm trying to get the unique names in column B after filtering column A and then pasting them in column C as following:
Range("A1:B1").Select
Selection.AutoFilter Field:=1, Criteria1:="=" + Type
Range("B1").Select
ActiveSheet.Range("B:B").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=ActiveSheet.Range("C1"), Unique:=True
However this will bypass the filtering of column A and will return all unique names of column B.
How can I use Autofilter or AdvancedFilter with multiple criterias?
Thanks,
you can go like follows
as you see the actual job is done in one line only, which is preceded by two "setting" lines (column "C" heading and filtering criteria temporary cells) and followed by one line for the deletion of temporary cells.
if you can't write in Range("D1:D2") you can use any other range (provided it's a 1 column-2 rows one) and change code accordingly.
or you can go with the "copying" approach