Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
right click hide
I would like to add a 'hide sheet' option to the right click menu per tab.
Can you help please? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
right click hide
Try code like the following:
Sub AddMenuItem() RemoveMenuItem With Application.CommandBars("Ply").Controls.Add( _ Type:=msoControlButton, temporary:=True) .Caption = "Hide The Sheet" .OnAction = "'" & ThisWorkbook.Name & "'!HideTheSheet" .Tag = "__HIDE_SHEET__" End With End Sub Sub HideTheSheet() Dim VisCount As Long Dim WS As Worksheet For Each WS In ActiveWorkbook.Worksheets If WS.Visible = xlSheetVisible Then VisCount = VisCount + 1 End If Next WS If VisCount 1 Then ActiveSheet.Visible = xlSheetHidden End If End Sub Sub RemoveMenuItem() On Error Resume Next Application.CommandBars.FindControl(Tag:="__HIDE_S HEET__").Delete End Sub "General" wrote in message ... I would like to add a 'hide sheet' option to the right click menu per tab. Can you help please? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
One-click hide or unhide rows & columns | Excel Worksheet Functions | |||
Hide/Unhide with cell double click | Excel Worksheet Functions | |||
Hide "Show details" when right click on data field in Pivot Table | Excel Discussion (Misc queries) | |||
Click on graph bar to execute a double-click in a pivot table cell | Charts and Charting in Excel | |||
Mouse Over Graph, Capture Information on Click(Double Click) | Excel Programming |