FuzzyTom
New Member
- Joined
- May 26, 2011
- Messages
- 24
Hi,
I have an advance filter with criteria as follows:
Range(ClientRange).AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range(ClntName), CopyToRange:=Range("AA2"), unique:=True
and it works just fine ... it copies the title and the data.
But in the next case I have no criteria as follows:
Range("F2").Select
Lastrow = Cells(Rows.Count, ActiveCell.Column).End(xlUp).Row
SiteRange = "F2:" & "F" & Lastrow
Range(SiteRange).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("AB2"), unique:=True
Range("AB2").Select
Lastrow = Cells(Rows.Count, ActiveCell.Column).End(xlUp).Row
SiteData = "AB2:" & "AB" & Lastrow
It only copies the title, which comes from F2, and puts it on AB2. If I check SiteRange it shows a range(F2:F518), so there is data there to copy.
On the other hand if you check SiteData it only shows a Range(AB2:AB2)
I must be missing something ... can anyone see it?
Thanks for any help.
I have an advance filter with criteria as follows:
Range(ClientRange).AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range(ClntName), CopyToRange:=Range("AA2"), unique:=True
and it works just fine ... it copies the title and the data.
But in the next case I have no criteria as follows:
Range("F2").Select
Lastrow = Cells(Rows.Count, ActiveCell.Column).End(xlUp).Row
SiteRange = "F2:" & "F" & Lastrow
Range(SiteRange).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("AB2"), unique:=True
Range("AB2").Select
Lastrow = Cells(Rows.Count, ActiveCell.Column).End(xlUp).Row
SiteData = "AB2:" & "AB" & Lastrow
It only copies the title, which comes from F2, and puts it on AB2. If I check SiteRange it shows a range(F2:F518), so there is data there to copy.
On the other hand if you check SiteData it only shows a Range(AB2:AB2)
I must be missing something ... can anyone see it?
Thanks for any help.