simple question

  • Thread starter Thread starter shlomop
  • Start date Start date
You can make it so that users can't scroll off the area that you set. But it
requires a small macro:

Option Explicit
Sub auto_open()
With Worksheets("sheet1")
.ScrollArea = "a1:g55"
End With
End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Another way:

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

E
 
I'm not sure I'd use the _selectionchange event. To toggle that setting to the
same range address each time you change selection seems a little overkill to me.
 
Each time the user changes the selection, this code will run:

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

After it's been set the first time, it's not changing anything.

But the code still runs each and everytime the user changes the selection.
 

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