View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Shortcut for the "Custom AutoFilter" window.

To get it to show "Contains", you have to feed it a dummy argument - but the
argument is highlighted, so you just type in what you want:

Sub Tester1()
Application.ExecuteExcel4Macro "FILTER?(3, ""=*BF*"",,)"

End Sub

Change the 3 to reflect the column you are working with.

--
Regards,
Tom Ogilvy



lothario wrote in message
...

Hi,

In this spreadsheet:
== There are 25 columns.
== Over 6000 rows.
== The first 10 columns have AutoFilter set.

To find certain rows of data I have to go thru these 4 steps:
1. Click on the filter button of the respective column.
2. Click on (Custom...) in the dropdown listbox to get the "Custom
AutoFilter" window.
3. Pull down the first dropdown listbox in the "Custom AutoFilter"
window.
4. Select the "contains" listbox item.

Then (finally) I enter my criteria in the second field and click the OK
button.

The above 4 steps are very inconvenient when I am doing over 30
searches every hour.

I would like to create a shortcut so that:
== I can place a button above the respective AutoFilter column.
== Call the button "Quick Search".
== Add VBA code to the button.

When this "Quick Search" button is clicked, the VBA code should
automatically:
1. Open the "Custom AutoFilter" window.
2. Select the "contains" listbox item from the first dropdown
listbox.
3. Place the cursor in the second field.
4. Wait for me to enter my criteria in the second field.

Then all I have to do is:
a. Enter my criteria in the second field.
b. Click the OK button.

Can you please give me the VBA code to add to my "Quick Search"
button?

Thanks,
Luther


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/