Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determine which column is filtered

Status
Not open for further replies.

wv1

Programmer
Feb 12, 2007
6
GB
Hi All
Is it possible to determine which column (1-8) has an autofilter currently ON within it?

i.e. If i have columns name, age, school and I have filtered on Column 3 to show only a certain school, is there anyway in a macro that can return to the user which column they currently have a filter on?

Many thanks
 
In my Excel (2003), the column(s) that are filtered has a blue drop down arrow, while the column(s) that are not filtered are black.
 
You will need to iterate through the Filters collection to obtain this info. There is some pretty good example code in the VBA helpfiles on this. Please have a look there and post back if you have any specific problems with the examples given there.

a VBA helpfile search on "Filter" or "Autofilter" should give you the appropriate results - choose the "filters collection" heading to get further details

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top