autofilter questions

G

Gary Keramidas

1. is there a limit to the number of criteria?
2. how do you construct the statement when there is a variable number of
criteria?
for example, if an array has 3 elements, how do you filter on the 3
criteria.

for i = lbound(arr) to ubound(arr)
.AutoFilter Field:=1, Criteria1:=arr(i)
next

i can't figure out to how construct Criteria(i).
 
D

Dave Peterson

You're limited by the same thing that you see when you do it manually.

In xl2003, there are two criteria.

I sometimes use a helper column with formulas that return true/false and then
filter by that column.
 
D

Dave Peterson

ps. Record a macro when you do it manually and you'll see the code that works.
 
G

Gary Keramidas

thanks dave, i think i'll just build a new report, probably take 10 minutes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top