![]() |
Restrictions on worksheet display
Is it possible to lock a
worksheet so that a) the user cannot move the cursor outside of a certain row range and a certain column range ? b) the use cannot change the location on the screen of the window displaying the worksheet, and he cannot change the size of the window displaying the worksheet? Thanks -- -regards |
Restrictions on worksheet display
You can protect the workbook windows and structure under
ToolsProtectionProtect Workbook to disallow resizing or moving. You can set the ScrollArea so users cannot move out of that area. Since the scrollarea method does not stick between sessions you will have to reset it each time. You may wish to place the code into a WorkBook_Open Sub in ThisWorkbook module and specify which worksheet if only one sheet required. Private Sub WorkBook_Open() Sheets("YourSheet").ScrollArea = "A1:M35" End Sub Or also in the Thisworkbook module to limit scrollarea on all sheets. Private Sub Workbook_SheetActivate(ByVal Sh As Object) With ActiveSheet .ScrollArea = "A1:M35" End With End Sub Gord Dibben MS Excel MVP On Tue, 24 Jul 2007 12:14:01 -0700, GeorgeJ wrote: Is it possible to lock a worksheet so that a) the user cannot move the cursor outside of a certain row range and a certain column range ? b) the use cannot change the location on the screen of the window displaying the worksheet, and he cannot change the size of the window displaying the worksheet? Thanks |
Restrictions on worksheet display
Thanks Gord. The stuff about scroll area was very helpful. Now suppose I
want to change back so the user can access all the cells of the sheet. What would the code be for that ? |
Restrictions on worksheet display
Assign this to a button or shortcut key.
Sub Scroll_All() Sheets("YourSheet").ScrollArea = "" End Sub Note: scrollarea will be re-set when you next open the workbook. Gord On Tue, 24 Jul 2007 15:14:06 -0700, GeorgeJ wrote: Thanks Gord. The stuff about scroll area was very helpful. Now suppose I want to change back so the user can access all the cells of the sheet. What would the code be for that ? |
All times are GMT +1. The time now is 07:05 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com