PC Review


Reply
Thread Tools Rate Thread

autofilter questions

 
 
Gary Keramidas
Guest
Posts: n/a
 
      29th Oct 2007
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).
--


Gary



 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      29th Oct 2007
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.



Gary Keramidas wrote:
>
> 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).
> --
>
> Gary


--

Dave Peterson
 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      29th Oct 2007
ps. Record a macro when you do it manually and you'll see the code that works.

Gary Keramidas wrote:
>
> 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).
> --
>
> Gary


--

Dave Peterson
 
Reply With Quote
 
Gary Keramidas
Guest
Posts: n/a
 
      29th Oct 2007
thanks dave, i think i'll just build a new report, probably take 10 minutes.

--


Gary


"Dave Peterson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
>
>
> Gary Keramidas wrote:
>>
>> 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).
>> --
>>
>> Gary

>
> --
>
> Dave Peterson



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel 2007 autofilter change to 2003 autofilter functionality? jonnybrovo815 Microsoft Excel Misc 1 19th Apr 2010 10:05 PM
2007 excel autofilter back to 2003 autofilter? jonnybrovo815 Microsoft Excel Misc 3 19th Apr 2010 08:11 PM
2007 excel autofilter change back to 2003 autofilter? jonnybrovo815 Microsoft Excel Misc 1 19th Apr 2010 05:53 PM
Questions: Copy ranges, autofilter macro, subtotals, & naming shee =?Utf-8?B?U21hbmdsZXI=?= Microsoft Excel Programming 2 11th Jun 2006 05:37 PM
Autofilter and zero's in blank field questions. BobT Microsoft Excel Worksheet Functions 3 12th Nov 2003 12:20 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:19 AM.