ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Fetch Autofilter options (https://www.excelbanter.com/excel-programming/399131-fetch-autofilter-options.html)

ashish128

Fetch Autofilter options
 
Hi to all,

I didnt knew what to type to search and therefore am posting this
request.


Whenever we autofilter a range and select any field then we get a
dropdown list of unique entries in that field.


1. If there is only one item then how to get that.


eg.


A
5
5
5
5


If I autofilter on column A then it will only contain 5. How can I
get
this value using VBA


2. how to get all of the the autofilter options?
eg.
A
1
2
3
1
2
3
1
2
3
if I autofilter on column A then the available options will be


A
1
2
3


howto get them using VBA.


Kindly advice.


With Regards


Ashish Sharma


Tom Ogilvy

Fetch Autofilter options
 
the option dropdowns in autofilter are not accessible using VBA. You can
create your own unique list with code or you can use the Advance filter to
produce a unique list to another location on the sheet.

here is sample code that performs the function:

http://www.j-walk.com/ss/excel/tips/tip47.htm

--
regards,
Tom Ogilvy


"ashish128" wrote:

Hi to all,

I didnt knew what to type to search and therefore am posting this
request.


Whenever we autofilter a range and select any field then we get a
dropdown list of unique entries in that field.


1. If there is only one item then how to get that.


eg.


A
5
5
5
5


If I autofilter on column A then it will only contain 5. How can I
get
this value using VBA


2. how to get all of the the autofilter options?
eg.
A
1
2
3
1
2
3
1
2
3
if I autofilter on column A then the available options will be


A
1
2
3


howto get them using VBA.


Kindly advice.


With Regards


Ashish Sharma




All times are GMT +1. The time now is 03:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com