ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Display set area (https://www.excelbanter.com/excel-programming/292253-display-set-area.html)

James[_19_]

Display set area
 
I have created a user interface on an Excel sheet. It
occupies Range A1:J21

Is it possible to show this area only? The rest of the
sheet is empty so I only want to display this range.
Hopefully, the function will not allow a user to scroll
anywhere. Is this a trim function? Could it be a lock
function?
I am teaching myself VB so a simple explanation would be
v. useful.

Many thanks,

James

papou[_7_]

Display set area
 
Hello James
To limit scrolling to a restricted range:
Right-click on worksheet tab View Code
Paste this:
Private Sub Worksheet_Activate()
ActiveSheet.ScrollArea = "A1:J21"
End Sub
To allow scrolling in whole sheet replace with:
ActiveSheet.ScrollArea = ""

HTH
Regards
Pascal



"James" a écrit dans le message de
...
I have created a user interface on an Excel sheet. It
occupies Range A1:J21

Is it possible to show this area only? The rest of the
sheet is empty so I only want to display this range.
Hopefully, the function will not allow a user to scroll
anywhere. Is this a trim function? Could it be a lock
function?
I am teaching myself VB so a simple explanation would be
v. useful.

Many thanks,

James





All times are GMT +1. The time now is 07:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com