PC Review


Reply
Thread Tools Rate Thread

AutoFilter-criteria with VBA in XL07

 
 
stefan onken
Guest
Posts: n/a
 
      6th May 2009
hi all,
Autofilter in XL2007 presents a unique list of items in the Autofilter-
Range.
using VBA, i want to get the checked items in this list.
I tried AutoFilter.Filters(1).Criteria1 and Criteria2 and got the
first 2 Criteria.
But how can i get the other Criteria ?


thanks
stefan

 
Reply With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      6th May 2009
Hi Stefan

You must use Advanced Filter to get the unique list
I use in the code example below for example
http://www.rondebruin.nl/copy5_3.htm



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"stefan onken" <(E-Mail Removed)> wrote in message news:84d64533-19e6-4827-873f-(E-Mail Removed)...
> hi all,
> Autofilter in XL2007 presents a unique list of items in the Autofilter-
> Range.
> using VBA, i want to get the checked items in this list.
> I tried AutoFilter.Filters(1).Criteria1 and Criteria2 and got the
> first 2 Criteria.
> But how can i get the other Criteria ?
>
>
> thanks
> stefan
>

 
Reply With Quote
 
stefan onken
Guest
Posts: n/a
 
      6th May 2009
hi Ron,

thanks.
as far as i can see the code creates the unique list which i have in
the Autofilter dialog.
what i need are the checked items in the unique list in the autofilter
dialog.
an example: in A1 is a title, in A2:A6 1 to 5.
in the autofilter dialog, i have the list with 1 to 5 (and choose
all).
if i check one or two of these items in the list,
Sheets(1).AutoFilter.Filters(1).Criteria1 resp. Criteria2 return my
checked items.
if i check three or more items in the list, Criteria1 and Criteria2 can
īt be used (runtimeerror 13).

Looks a bit like MS has forgotten, that more than two Criteria are
possible in 2007.

stefan

On 6 Mai, 17:06, "Ron de Bruin" <rondebr...@kabelfoon.nl> wrote:
> Hi Stefan
>
> You must use Advanced Filter to get the unique list
> I use in the code example below for examplehttp://www.rondebruin.nl/copy5_3.htm
>





 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      6th May 2009
2 is the max in 2007 also with code
Seems not to be possible to get the complete list from the AutoFilter dropdown or the ones that are checked.
I checked that last month but the answer was No



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"stefan onken" <(E-Mail Removed)> wrote in message news:8bfe90c2-b7a7-4ebf-bbcd-(E-Mail Removed)...
hi Ron,

thanks.
as far as i can see the code creates the unique list which i have in
the Autofilter dialog.
what i need are the checked items in the unique list in the autofilter
dialog.
an example: in A1 is a title, in A2:A6 1 to 5.
in the autofilter dialog, i have the list with 1 to 5 (and choose
all).
if i check one or two of these items in the list,
Sheets(1).AutoFilter.Filters(1).Criteria1 resp. Criteria2 return my
checked items.
if i check three or more items in the list, Criteria1 and Criteria2 can
īt be used (runtimeerror 13).

Looks a bit like MS has forgotten, that more than two Criteria are
possible in 2007.

stefan

On 6 Mai, 17:06, "Ron de Bruin" <rondebr...@kabelfoon.nl> wrote:
> Hi Stefan
>
> You must use Advanced Filter to get the unique list
> I use in the code example below for examplehttp://www.rondebruin.nl/copy5_3.htm
>





 
Reply With Quote
 
stefan onken
Guest
Posts: n/a
 
      6th May 2009
thank you for confirming

many greetings from germany
(and by the way many thanks for your webpage, often linked in the
german XL-newsgroup)
stefan


On 6 Mai, 19:16, "Ron de Bruin" <rondebr...@kabelfoon.nl> wrote:
> 2 is the max in 2007 also with code
> Seems not to be possible to get the complete list from the AutoFilter dropdown or the ones that are checked.
> I checked that last month but the answer was No
>
> --

 
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
Autofilter Criteria Paul Martin Microsoft Excel Programming 2 27th Oct 2008 09:05 PM
AutoFilter Criteria in VBA =?Utf-8?B?QWJoaQ==?= Microsoft Excel Programming 5 25th Apr 2007 05:37 PM
Selection.AutoFilter Field / Criteria => criteria sometimes non-existing on worksheet markx Microsoft Excel Programming 1 24th Nov 2006 02:52 PM
More Criteria for AutoFilter Murtaza Microsoft Excel Discussion 5 15th Mar 2004 11:43 PM
VBA Autofilter Criteria Brandon Microsoft Excel Programming 1 7th Nov 2003 12:40 PM


Features
 

Advertising
 

Newsgroups
 


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