Hi,
I can do this a little long-winded way but I am wondering on the most efficient way of doing the following:
So I have found code that can filter unique values based on one column but I am unable to set a criterial within the line of code.
Another method is to do code using the With Statement and I am able to paste the columns to a new worksheet but it'll paste the whole range including duplicates
I guess I can just remove the duplicates after pasting to the new worksheet but out of interest can I apply criteria in the code above?
Thanks!
I can do this a little long-winded way but I am wondering on the most efficient way of doing the following:
- Go to a worksheet and then filter a column with a certain value
- Once filtered, select a range from another column
- Copy this select column and ensure values are unique
So I have found code that can filter unique values based on one column but I am unable to set a criterial within the line of code.
Code:
[COLOR=#333333]Public Sub Test()[/COLOR]
ActiveSheet.Range("A2:A65536").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=ActiveSheet.Range("B2"), Unique:=True
[COLOR=#333333]End Sub[/COLOR]
Another method is to do code using the With Statement and I am able to paste the columns to a new worksheet but it'll paste the whole range including duplicates
I guess I can just remove the duplicates after pasting to the new worksheet but out of interest can I apply criteria in the code above?
Thanks!
Last edited: