How to show 'Custom Auto Filter' dialog?

M

michael.beckinsale

Hi all,

What l would like to do using VBA is show the 'Custom Auto Filter'
dialog and additionally set the
'Show rows where:' to 'begins with'

Once the form is showing with the default as above l want to exit the
macro and pass control to the user. They would then enter the 'begins
with' criteria click OK and the rows would be filtered accordingly.

Any help in coding this / pointing me in the right direction gretafully
appreciated.

Regards

Michael Beckinsale
 
N

Nigel

I suspect you would be able to use the Application.Dialogs() function, but I
do not believe there is one for the filter selection drop down
Alternatively create your own userform and simulate the selection, then
apply this directly to the filter criteria settings.
 
M

michael.beckinsale

Nigel,

I considered the 'input box' method but l really wanted to give the
user more choice with the custom filter and didn't want to re-invent
the wheel by re-constructing the same thing via a userform.

The following code does pretty much what l want. The only downside l
can see is that the criteria box has a ? in it and takes the focus.

Application.ExecuteExcel4Macro "Filter?(1,""?*"")"

Regards

Michael Beckinsale
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top