Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Simon
Incorporate the following into your existing sub to create the new button... -------------------- Dim c As Variant With Application.CommandBars("Worksheet Menu Bar") For Each c In .Controls If c.Caption = "EN" Then c.Delete Next c ..Controls.Add Type:=msoControlButton, ID:=2950, Befo=1 ..Controls(1).Caption = "EN" ..Controls(1).TooltipText = "Enable Events" ..Controls(1).OnAction = ThisWorkbook.Name & "!enevents" ..Controls(1).Style = msoButtonCaption End With End Sub -------------------- and add this new sub.... Sub enevents() Application.EnableEvents = Not Application.EnableEvents End Sub -- XL2002 Regards William "Simon Lloyd " wrote in message ... | Hello all!, | | I have created a custom button that when clicked displays all hidden | sheets and also displays the worksheet menu bar, what i would like to | happen is that when this button is clicked that along with the above a | new button appears on the menubar marked disable/enable, so that when | this button is clicked it disables events for that sheet and when | clicked again enables events! | | Thanks, | | Simon. | | | --- | Message posted from http://www.ExcelForum.com/ | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
enabling/disabling a set of code from within a spreadsheet sheet | Excel Discussion (Misc queries) | |||
Enabling Events | Excel Discussion (Misc queries) | |||
Disabling code using a button? | Excel Programming | |||
Disabling/Enabling Macros | Excel Programming | |||
Enabling/Disabling Macros | Excel Programming |