|
Sub 添加工作表隐藏()
On Error Resume Next
Dim X, copup As CommandBarPopup, copup1 As CommandBarButton, copup2 As CommandBarButton, copup3 As CommandBarButton, copup4 As CommandBarButton
Application.CommandBars(1).Controls("隐藏工作表").Delete
Set copup = Application.CommandBars(1).Controls.Add(Type:=msoControlPopup, before:=1) '添加到最上的位置
With copup
.Caption = "隐藏工作表"
.BeginGroup = True '添加分组线
End With
Set copup1 = copup.Controls.Add(before:=1) '添加到最上的位置
With copup1
.Caption = "深度隐藏工作表"
.OnAction = "深度隐藏工作表"
End With
Set copup2 = copup.Controls.Add(before:=2) '添加到最上的位置
With copup2
.Caption = "取消深度隐藏工作表"
.OnAction = "取消深度隐藏工作表"
End With
Set copup3 = copup.Controls.Add(before:=3) '添加到最上的位置
With copup3
.Caption = "隐藏当前工作表"
.OnAction = "隐藏当前工作表"
End With
End Sub |
|