Hide Toolbars

Hide Toolbar


Protect your spreadsheet by hiding the tools with the VBA code below.
To run the code, insert the command buttons on the worksheet.
See the Add and Change button color example.
Download Example

'Paste the code below into the module

Sub Display_options_range ()
Application.ExecuteExcel4Macro "SHOW.TOOLBAR (" "Ribbon" ", True)"
End Sub
Sub Hide_range_options ()
Application.ExecuteExcel4Macro "SHOW.TOOLBAR (" "Ribbon" ", False)"
End Sub
Sub Hide_Formulas_Bar ()
Application.DisplayFormulaBar = False
End Sub
Sub View_Formulas_Bar ()
Application.DisplayFormulaBar = True
End Sub
Sub Hide_Column_name ()
ActiveWindow.DisplayHeadings = False
End Sub
Sub Display_Column_name ()
ActiveWindow.DisplayHeadings = True
End Sub
Sub Hide_Lines_of_Grade ()
ActiveWindow.DisplayGridlines = False
End Sub
Sub Display_Grid_Lines ()
ActiveWindow.DisplayGridlines = True
End Sub
Sub Hide_Bars_Rolling_Vertical ()
ActiveWindow.DisplayVerticalScrollBar = False
End Sub
Sub View_Bars_Rolling_Vertical ()
ActiveWindow.DisplayVerticalScrollBar = True
End Sub
Sub Hide_Bars_Rolling_Horizontal ()
ActiveWindow.DisplayHorizontalScrollBar = False
End Sub
Sub View_Barras_Rolagem_Horizontal ()
ActiveWindow.DisplayHorizontalScrollBar = True
End Sub
Sub Hide_Folder ()
Sheets ("Plan2"). Visible = xlVeryHidden
End Sub
Sub View_Folder ()
Sheets ("Plan2"). Visible = xlSheetVisible
End Sub
Sub hide_tabs ()
ActiveWindow.DisplayWorkbookTabs = False
End Sub
Sub preview_tabs ()
ActiveWindow.DisplayWorkbookTabs = True
End Sub
Share by: