Limit workspace size

  • Thread starter Thread starter Scratchtfoot
  • Start date Start date
S

Scratchtfoot

How does one restrict use in a small spreasdheet (15 columns x 30 rows)?
There's no need for other users to access the rest of the workspace, and I
would like to ensure that there is no confusion about the unused columns and
rows.
 
Hello

You can hide unused rows and columns.

Or you could set the scrollarea in VBA to some range. Mind that this last
option is not retained when you close and reopen the file.
 
Since the scrollarea method does not stick between sessions you will have to
reset it each time you open the workbook.

You may wish to place the code into a WorkBook_Open Sub in ThisWorkbook module
and specify which worksheet if only one sheet required.

Adjust the sheetname and range to suit.

Private Sub WorkBook_Open()
Sheets("YourSheet").ScrollArea = "A1:M36"
End Sub

Or this in the Thisworkbook module to limit scrollarea on all sheets.

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
With ActiveSheet
.ScrollArea = "A1:M36"
End With
End Sub


Gord Dibben MS Excel MVP
 

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

Back
Top