Display set area

  • Thread starter Thread starter James
  • Start date Start date
J

James

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
 
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
 
Back
Top