There are links in Possible Answers section at the bottom of this thread that address this very topic. Have you tried them?
You don't need to select cells in VBA, just reference them and act on them. Also, it is best to set the paste range as a single cell and let Excel adjust the size of the paste range.
VB:ActiveSheet.Columns("D:D").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("A6001"), Unique:=True