Sub UnHide() ' Dim xShtNames, i ' xShtNames = Split("Sheet2;Sheet3", ";") For i = LBound(xShtNames) To UBound(xShtNames) Sheets(xShtNames(i)).Visible = True Next i End Sub
Option Explicit Sub RemoveBar() On Error Resume Next Application.CommandBars("xlDemoToolbar").Delete End Sub Sub CreateBar() Dim oBar As CommandBar Dim oControl As CommandBarControl RemoveBar Set oBar = Application.CommandBars.Add oBar.Name = "xlDemoToolbar" oBar.Visible = True Set oControl = oBar.Controls.Add(ID:=1, Before:=1) oControl.OnAction = "ButtonClicked" oControl.FaceId = 275 oControl.Caption = "Klikni na mňa!" Set oControl = Nothing Set oBar = Nothing End Sub Sub ButtonClicked() MsgBox "Funguje to!!!" End Sub
odkryť hárky