![]() |
|
|
Welcome to the { mindfrost82.com } forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Filter: Macro/CommandButton - Show filtered data-Show all
Hey Guys
I intend my macro to do this: If autofilter is activated then show all, if not then activate autofilter . - a kind of on/off autofiler-button based on some "spagetti"- programming of mine: Selection.AutoFilter Field:=7, Criteria1:="MTO OK" ActiveSheet.ShowAllData .... but I struggle to make this work, and humberly ask you guys for help. Best Regards Snoopy |
|
|||
|
Re: Filter: Macro/CommandButton - Show filtered data-Show all
With Worksheets("sheet1")
If .FilterMode Then .ShowAllData else Selection.AutoFilter Field:=7, Criteria1:="MTO OK" End If End With But I really don't like using the current selection. Maybe... ..range("a1").currentregion.AutoFilter Field:=7, Criteria1:="MTO OK" would be safer. Snoopy wrote: > > Hey Guys > > I intend my macro to do this: > If autofilter is activated then show all, if not then activate > autofilter . > > - a kind of on/off autofiler-button based on some "spagetti"- > programming of mine: > > Selection.AutoFilter Field:=7, Criteria1:="MTO OK" > ActiveSheet.ShowAllData > > ... but I struggle to make this work, and humberly ask you guys for > help. > > Best Regards > Snoopy -- Dave Peterson |
![]() |
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|