Select the product you need help with
- Internet Explorer
- Windows Phone
- More products
XL97: How to Remove Individual AutoFilter Drop-Down Lists
Article ID: 162049 - View products that this article applies to.
This article was previously published under Q162049
In Microsoft Excel 97, you can programmatically hide an AutoFilter drop-down list for a specific field in a list by using a new argument for the AutoFilter method in Microsoft Visual Basic for Applications.
This article includes an example Visual Basic macro that hides drop-down lists in a list to which you applied an AutoFilter.
NOTE: The only way to hide individual drop-down lists in a list to which you applied an AutoFilter is to use the AutoFilter method in a macro; you cannot hide the drop-down list manually.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs.
If you have limited programming experience, you may want to contact a Microsoft Certified Partner or Microsoft Advisory Services. For more information, visit these Microsoft Web sites:
Microsoft Certified Partners - https://partner.microsoft.com/global/30000104
Microsoft Advisory Services - http://support.microsoft.com/gp/advisoryservice
For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS
Syntax for the AutoFilter MethodUse the following syntax for the AutoFilter method:
<expression>.AutoFilter(Field, Criteria1, Operator, Criteria2, Visibledropdown)where <expression> is an expression that returns a Range object. <Expression> is required for the AutoFilter method. The following table lists the optional arguments for the AutoFilter method and the descriptions for the arguments.
Argument Description ---------------------------------------------------------------------- Field The integer offset of the field on which you want to filter the list (the first field in your list has a value of 1) Criteria1 The criteria for filtering the specified field Operator Used to construct compound criteria Criteria2 Used in conjunction with Criteria1 and Operator to build compound criteria Visibledropdown True or False; false hides the drop-down list for the specified field
There is no drop-down list for the Area field.
A1: Name B1: Area C1: Amount A2: Bob B2: East C2: 1 A4: Bill B4: East C4: 3
NOTE: The Visibledropdown argument for the AutoFilter method is not listed in the "AutoFilter Method" Help topic. Also, because the AutoFilter method is a write-only method, you cannot programmatically determine which fields in the list have drop-down lists that are hidden or unhidden.
For more information about the AutoFilter method, click the Office Assistant, type autofilter, click Search, and then click to view "AutoFilter Method".
NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If <Product> Help is not installed on your computer, please see the following article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/120802/EN-US/ )Office: How to Add/Remove a Single Office Program or Component
Article ID: 162049 - Last Review: November 23, 2006 - Revision: 2.2