how do I hide scroll bars on specific sheets within a workbook

G

Guest

I have a workbook with many sheets within it. On some sheets I would like to
hide the scroll bars (horizontal and vertical) but would like to keep them on
other sheets.
 
G

Guest

You could use this. Alt + F11 to open VB editor. Double click this workbook
and paste this in. You would need to add extra cases for the names of the
worksheets where you don't want the scrollbars visible.

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Select Case ActiveSheet.Name
Case "Sheet1"
With ActiveWindow
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
End With
Case Else
With ActiveWindow
.DisplayHorizontalScrollBar = True
.DisplayVerticalScrollBar = True
End With
End Select
End Sub

Mike
 
G

Guest

Just realised my post is misleading. You edit this line to add extra cases:-

Case "Sheet1", "Sheet3", "Sheet5"

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top