Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm using a class to hook events for existing toolbar buttons as decribed
Professional Excel Development. The sheet that the code applies to is protected with AllowFiltering. I want the user to be able to turn Filter on and off. The only way I've found to do so is to set a dummy OnAction for the filter button. This makes it available (all the time that the Worsheet Menu Bar is visible, I think). Is there a better way? Here's the class module code: Public WithEvents filter_class_button_899 As CommandBarButton Private Sub Class_Initialize() Set filter_class_button_899 = Application.CommandBars.FindControl(ID:=899) filter_class_button_899.OnAction = "dummy_sub" End Sub Private Sub Class_Terminate() filter_class_button_899.Reset End Sub Private Sub filter_class_button_899_Click(ByVal Ctrl As Office.CommandBarButton, CancelDefault As Boolean) Call toggle_filter 'basically "range.Autofilter" filter_class_button_899.State = Not filter_class_button_899.State End Sub Thanks, Doug Glancy |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Enabling Spell Check in Protected Worksheet | Excel Discussion (Misc queries) | |||
Worksheet protected-auto filter works, show all button dosen't. | Excel Discussion (Misc queries) | |||
Class module to filter textbox entry | Excel Programming | |||
Variable from a sheet module in a class module in XL XP | Excel Programming | |||
Enabling comments on a protected worksheet | Excel Programming |