Dear Friends,

While developing some Excel VBA based tool in Excel, you might find this useful when you want to disable or enable horizontal or vertical scrolling in excel automatically.
It is very easy to disable Horizontal or Vertical Scroll bar using VBA code. They are self explanatory by the way. So here you go:


VBA code to Show Horizontal or Vertical Scroll bar


Sub ScrollOn()
With ActiveWindow
.DisplayHorizontalScrollBar=True
.DisplayVerticalScrollBar=True
.DisplayWorkbookTabs=True
End With

VBA code to hide Horizontal or Vertical Scroll bar


Sub ScrollOn()
With ActiveWindow
.DisplayHorizontalScrollBar=False
.DisplayVerticalScrollBar=False
.DisplayWorkbookTabs=False
End With

How to Show/Hide Scroll Bars without VBA Code

It is also possible to show or hide Scroll bars of Excel in Excel Options as well. I have written this below article to show how to achieve this manually :

Hide/Display Horizontal/Vertical Bar in an Excel Workbook

cover3d_0-89071700_1484285537__1_

Join over 10, 000+ Excel VBA Enthusiasts & get this FREE e-Book Now!