VBA: Turn On/Off Scroll Bars
You can toggle scrollbars On or Off using a macro:
Turn On Scrollbars:
Sub TurnOnScroll()
With ActiveWindow
.DisplayHorizontalScrollBar = True
.DisplayVerticalScrollBar = True
End With
End Sub
Turn Off Scrollbars:
Sub TurnOffScroll()
With ActiveWindow
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
End With
End Sub
Can't get the tutorial to work for you? Need help with your code?
Get answers right away at our AE Excel Support Forums!
Get answers right away at our AE Excel Support Forums!



How can I switch between on and off of both scrollbars ?
Sub ToggHorizBarl()
‘ This example toggles the horizontal scroll bar of the actual window
Dim winTemp As Window
Set winTemp = ActiveWindow
winTemp.DisplayHorizontalScrollBar = _
Not winTemp.DisplayHorizontalScrollBar
End Sub
Is this a trick question, or did I misunderstand it?
The example toggles both scroll bars on or off….
To toggle just the Horizontal scrollbar, delete the Vertical code,, and vice versa.
This just toggles the vertical bar:
Sub ToggVertOFF() With ActiveWindow .DisplayVerticalScrollBar = False End With End Sub Sub ToggVertON() With ActiveWindow .DisplayVerticalScrollBar = True End With End Sub