Hi,
I tried to filter and copy part of a data tab to another tab where some manipulation may be carried out. Here is part of the statements:
....
Range(ThisWorkbook.Names("rngtest")) _
.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("temptab").Range("t1:aa2"), _
CopyToRange:=Sheets("temptab").Range("a1"), Unique:=False
Sheets("temptab").Activate
....
You can see the CriteraRange has 8 fields (column T to AA). If any of the cells (Range("t1:aa2")) left blank, no data will come out; or I have to change the range to, say, Range("t1:t2") if cell t2 has value in it. So I can get data.
I remember it worked before: if 7 out of 8 fields are blank, the data was supposed to come out based on the single field with value in it. But it's not happening.
AdvancedFilter is a pain in the neck. It won't give you error code for you to trace upon. No error, no data, nothing.
Thanks in advance.
I tried to filter and copy part of a data tab to another tab where some manipulation may be carried out. Here is part of the statements:
....
Range(ThisWorkbook.Names("rngtest")) _
.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("temptab").Range("t1:aa2"), _
CopyToRange:=Sheets("temptab").Range("a1"), Unique:=False
Sheets("temptab").Activate
....
You can see the CriteraRange has 8 fields (column T to AA). If any of the cells (Range("t1:aa2")) left blank, no data will come out; or I have to change the range to, say, Range("t1:t2") if cell t2 has value in it. So I can get data.
I remember it worked before: if 7 out of 8 fields are blank, the data was supposed to come out based on the single field with value in it. But it's not happening.
AdvancedFilter is a pain in the neck. It won't give you error code for you to trace upon. No error, no data, nothing.
Thanks in advance.