ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Marco to open the "Customer Auto filter dialog box" (https://www.excelbanter.com/excel-programming/431863-marco-open-customer-auto-filter-dialog-box.html)

Johnnyboy5

Marco to open the "Customer Auto filter dialog box"
 
The issue I've encountered is that the macro recorder can't be stopped
with the Custom Autofilter Dialog Box open. Is it possible to create a
macro to select "(Custom...)" from the drop down list, and have the
dialog box appears ready to enter what needs to be sorted.


Thanks very much ... its driving me MAD !

arjen van...

Marco to open the "Customer Auto filter dialog box"
 
If you're using the macro recorder, you can just close the dialog box and
then stop the recorder. Then go back and edit your code, deleting everyting
that appears after the line opening the dialog box.

Johnnyboy5

Marco to open the "Customer Auto filter dialog box"
 
On 31 July, 16:59, arjen van... wrote:
If you're using the macro recorder, you can just close the dialog box and
then stop the recorder. Then go back and edit your code, deleting everyting
that appears after the line opening the dialog box.


Thanks, but i cant work out what needs to be deleted, there is very
little there. Can you show me a copy.

regards

J

arjen van...

Marco to open the "Customer Auto filter dialog box"
 
I think I understand your question now, you just want the dialog box to
display so the user can enter their own criteria and then carry on with the
procedure. Macro recorder doesn't give the dialog box name and I don't know
it.

For a list of all dialog boxes, in Visual Basic Editor hit F2, then click on
Classes and xlBuiltInDialog in the list. Actually, I'm not sure if the list
includes everything.

Generally to show a dialog box, the code is:

Application.Dialogs(xlDialogActiveCellFont).Show

where the piece in the brackets is the specific dialog box you need.

Dave Peterson

Marco to open the "Customer Auto filter dialog box"
 
You can look at VBA's help to see all the possible dialogs -- or use the object
browser and see a couple more that are hidden.

But when I did that, I didn't see any that looked like they matched the custom
autofilter dialog.

I'm not saying it can't be done. But I don't see how to do it.

If I _had_ to do it, I think I'd end up with a homemade userform that mimicked
that dialog thingy.

arjen van... wrote:

I think I understand your question now, you just want the dialog box to
display so the user can enter their own criteria and then carry on with the
procedure. Macro recorder doesn't give the dialog box name and I don't know
it.

For a list of all dialog boxes, in Visual Basic Editor hit F2, then click on
Classes and xlBuiltInDialog in the list. Actually, I'm not sure if the list
includes everything.

Generally to show a dialog box, the code is:

Application.Dialogs(xlDialogActiveCellFont).Show

where the piece in the brackets is the specific dialog box you need.


--

Dave Peterson


All times are GMT +1. The time now is 06:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com