ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Use the custom filter dialog in a macro (https://www.excelbanter.com/excel-worksheet-functions/198445-use-custom-filter-dialog-macro.html)

KenInPortland

Use the custom filter dialog in a macro
 
I need some guidance. I can use the recorder but don't understand how to
initiate and put the parameters into an existing Excel dialog. I hope this is
doable.

I want to initiate the custom filter dialog box using a macro with the
column fixed (say column E) beginning at row 33 with parameters set to
"contain" then allow a user to enter the two search words and perform the
filter.

Then I need another macro to essentially do a "filter all" and display all
the rows.

Thanks,

Héctor Miguel

Use the custom filter dialog in a macro
 
hi, Ken !

I need some guidance.
I can use the recorder but don't understand how to initiate and put the parameters into an existing Excel dialog.
I hope this is doable.
I want to initiate the custom filter dialog box using a macro with the column fixed (say column E)
beginning at row 33 with parameters set to "contain" then allow a user to enter the two search words and perform the filter.
Then I need another macro to essentially do a "filter all" and display all the rows...


use the "ancient" xl4 macro-functions to "ask/show" *that* dialog to the user...
previously "send" a keystroke sequence to the parameters "preparation"...
and let the user to finish the job (i.e.)

assuming column E is the 5th filtered field in your layout...

Sub Show_CustomFiterDialog()
SendKeys "+{tab}{down}{end}{up}{tab}"
ExecuteExcel4Macro "filter?(5)"
End Sub

there are several ways to "show all" and/or quit the autofilter mode

regards,
hector.



KenInPortland

Use the custom filter dialog in a macro
 
Thank you Hector. Works great! I appreciate it.

"Héctor Miguel" wrote:

hi, Ken !

I need some guidance.
I can use the recorder but don't understand how to initiate and put the parameters into an existing Excel dialog.
I hope this is doable.
I want to initiate the custom filter dialog box using a macro with the column fixed (say column E)
beginning at row 33 with parameters set to "contain" then allow a user to enter the two search words and perform the filter.
Then I need another macro to essentially do a "filter all" and display all the rows...


use the "ancient" xl4 macro-functions to "ask/show" *that* dialog to the user...
previously "send" a keystroke sequence to the parameters "preparation"...
and let the user to finish the job (i.e.)

assuming column E is the 5th filtered field in your layout...

Sub Show_CustomFiterDialog()
SendKeys "+{tab}{down}{end}{up}{tab}"
ExecuteExcel4Macro "filter?(5)"
End Sub

there are several ways to "show all" and/or quit the autofilter mode

regards,
hector.




Héctor Miguel

Use the custom filter dialog in a macro
 
hi, Ken !

Thank you Hector. Works great! I appreciate it.


thanks to you, Ken, for your feed-back ;)

regards,
hector.

__ OP __
I need some guidance.
I can use the recorder but don't understand how to initiate and put the parameters into an existing Excel dialog.
I hope this is doable.
I want to initiate the custom filter dialog box using a macro with the column fixed (say column E)
beginning at row 33 with parameters set to "contain" then allow a user to enter the two search words and perform the filter.
Then I need another macro to essentially do a "filter all" and display all the rows...


use the "ancient" xl4 macro-functions to "ask/show" *that* dialog to the user...
previously "send" a keystroke sequence to the parameters "preparation"...
and let the user to finish the job (i.e.)

assuming column E is the 5th filtered field in your layout...

Sub Show_CustomFiterDialog()
SendKeys "+{tab}{down}{end}{up}{tab}"
ExecuteExcel4Macro "filter?(5)"
End Sub

there are several ways to "show all" and/or quit the autofilter mode





All times are GMT +1. The time now is 02:58 PM.

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