ValerieT
03-06-2015, 08:39 AM
Hello
MySheet = ActiveSheet.Name
With Sheets(MySheet)
.Range("C1:C" & lastrow).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=.Range("D1"), Unique:=True
End With
that copy colum C into colum D, removing duplicate. Works fine
Now I want to copy to an horizontal row but what ever I try
(ex: CopyToRange:=.Range("D1:ZZ1"))
I've got an error 401 with no explanation. Lengh of the range is unknown (as I don't know how duplicates are in the list) so I need a flexible solution (may be the problem is that the range doesn't fit the copied buffer)
Thanks!
MySheet = ActiveSheet.Name
With Sheets(MySheet)
.Range("C1:C" & lastrow).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=.Range("D1"), Unique:=True
End With
that copy colum C into colum D, removing duplicate. Works fine
Now I want to copy to an horizontal row but what ever I try
(ex: CopyToRange:=.Range("D1:ZZ1"))
I've got an error 401 with no explanation. Lengh of the range is unknown (as I don't know how duplicates are in the list) so I need a flexible solution (may be the problem is that the range doesn't fit the copied buffer)
Thanks!