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 - 28 Nov 2007 12:21 GMT
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.
> Hey Guys
>
[quoted text clipped - 13 lines]
> Best Regards
> Snoopy

Signature
Dave Peterson