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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Autofilter Dialog

Status
Not open for further replies.

MrProgrammer

Programmer
Joined
Feb 1, 2002
Messages
41
Location
TR
I want to show Custom Autofilter dialog box by code in the VB Editor. I tried to use save macro option. But it save some code like below.

Selection.AutoFilter Field:=1, Criteria1:="=", Operator:=xlAnd

This code is the result of the dialog box. I want to show the "Custom Autofilter" dialog box(Data-Filter-Autofilter then Custom) by code. How can I do this?????
 
There is no AutoFilter Dialog box as such. When you select Data, AutoFilter Excel just toggles Dropdown buttons on the headers of the current region. From code Selection.Autofilter has the same effect - no need to select a range, just make sure the selected cell is the data you want filtered.

If you want to get criteria interactively from your users you will probably need to build a userform, or use teh Advanced Filter, the dialog of which can be invoked via code with

Application.Dialogs(xlDialogFilterAdvanced).Show

AC
 
I think I couldn't exactly explain my problem! I know that when we choose Data--Filter--Autofilter Excel just toggles Dropdown buttons on the headers of the current region. when we click "Custom" option in these Dropdown buttons,"Custom Autofilter" dialog box appears. Is there any way of showing this dialog box with some code ??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top