Switching off all worksheet tabs

insomniac53

Board Regular
Joined
Sep 3, 2013
Messages
102
I can switch off worksheet tabs by adding the following code to the Activate sub of each worksheet.
Code:
ActiveWindow.DisplayWorkbookTabs = False
but if I try looping through all the sheets like this:
Code:
Sub SwitchOffAllTabs()
    Dim w As Worksheet
    ScreenUpdating = False
    For Each w In ThisWorkbook.Sheets
        w.Activate
        ActiveWindow.DisplayWorkbookTabs = False
    Next
    ScreenUpdating = True
    MsgBox "Done"
End Sub
it doesn't work.
Can anyone tell me what's wrong? Thanks
 

Some videos you may like

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Try just

Code:
Sub test()
ActiveWindow.DisplayWorkbookTabs = False
End Sub
 

insomniac53

Board Regular
Joined
Sep 3, 2013
Messages
102
Okay! I thought that command switched off tabs for just one sheet. Live and learn. Thanks!
 

Watch MrExcel Video

Forum statistics

Threads
1,109,521
Messages
5,529,326
Members
409,863
Latest member
stacy09
Top