Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default autofilter questions

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



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default autofilter questions

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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default autofilter questions

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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default autofilter questions

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

--


Gary


"Dave Peterson" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel 2007 autofilter change to 2003 autofilter functionality? jonnybrovo815 Excel Discussion (Misc queries) 1 April 19th 10 10:05 PM
2007 excel autofilter change back to 2003 autofilter? jonnybrovo815 Excel Discussion (Misc queries) 1 April 19th 10 05:53 PM
Answers to questions posing more questions in a workbook sbelle1 Excel Worksheet Functions 2 August 8th 09 01:02 AM
View Questions and Answer to questions I created Roibn Taylor Excel Discussion (Misc queries) 4 July 24th 08 12:05 AM
Questions: Copy ranges, autofilter macro, subtotals, & naming shee Smangler Excel Programming 2 June 11th 06 05:37 PM


All times are GMT +1. The time now is 09:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"