Excel VBA: Hiding Sheet Tabs

This Excel VBA macro hides sheet tabs in an active workbook.

Macro Examples

Sub HideSheetTabs()

  ActiveWindow.DisplayWorkbookTabs = False

End Sub

Description

(Application.)ActiveWindow

  ActiveWindow...

The Application.ActiveWindow property returns the Window object that represents an active window.

obj-Excel-Application-ActiveWindow

The ActiveWindow property is a member of the Excel.Global class, so we can omit the Application property.

obj-Excel-Global-ActiveWindow

ActiveWindow.DisplayWorkbookTabs (Window.DisplayWorkbookTabs)

  ActiveWindow.DisplayWorkbookTabs...

The ActiveWindow.DispalyWorkbookTabs (Window.DisplayWorkbookTabs property) returns or sets a value that indicates whether the workbook tabs (sheets tabs) are displayed.

obj-Excel-Window-DisplayWorkbookTabs

In this macro, I set it to False so the sheet tabs will be hidden.

  ActiveWindow.DisplayWorkbookTabs = False

Properties

http://www.relief.jp/itnote/archives/003385.php

Apply to

  • Excel 2013
  • Excel 2010
  • Excel 2007