Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

ScrollArea values help Excel 2007

Status
Not open for further replies.

Clyde38

Electrical
Joined
Oct 31, 2003
Messages
533
Location
US
When I set the ScrollArea in the properties for a worksheet, all is well. When I save the workbook and then reopen, the ScrollArea properties is blank and scrolling is not locked. The worksheet is protected. How do I retain the ScrollArea setting?

[link ]
btn_liprofile_blue_80x15.gif" width="80" height="15" border="0" alt="View Clyde's profile on LinkedIn
[/url]
 
This works, but you have to make a selection before the scroll area is locked.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Me.ScrollArea = "E6:R38"
End Sub


Is there a way to have this active when the workbook is opened?


[link ]
btn_liprofile_blue_80x15.gif" width="80" height="15" border="0" alt="View Clyde's profile on LinkedIn
[/url]
 
In the Workbook Module, Paste this code:

Code:
Private Sub Workbook_Open()
    Range("E6:R38").Select
    Me.ScrollArea = "E6:R38"
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top