Scroll Area

  • Thread starter Thread starter Bhuktar S
  • Start date Start date
You can't.

You can simulate it by using the Worksheet_SelectionChange() event to
intercept selections outside the areas and return the selection to your
areas.

Assume the two areas are A1:J10 and A21:J30. Put this in the Worksheet
code module (right click on the worksheet tab and choose View Code):

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Static rOldSelection As Range
Static rScrollArea1 As Range
Static rScrollArea2 As Range

If rScrollArea1 Is Nothing Then _
Set rScrollArea1 = Range("A1:J10")
If rScrollArea2 Is Nothing Then _
Set rScrollArea2 = Range("A21:J30")
If rOldSelection Is Nothing Then _
Set rOldSelection = Range("A1")

Application.EnableEvents = False

If Not Intersect(Target, rScrollArea1) Is Nothing Then
Intersect(Target, rScrollArea1).Select
ElseIf Not Intersect(Target, rScrollArea2) Is Nothing Then
Intersect(Target, rScrollArea2).Select
Else
rOldSelection.Select
End If
Set rOldSelection = Selection

Application.EnableEvents = True
End Sub


Private Sub In article <[email protected]>,
 
Hi! "Bhuktar S >",

I don't understand exactly what you want,
but how about this:
Select any cell, then Windows Menu | Split

Try to select any cell on the very upper row , rightmost row or else,
then split-window.

If you like Macro, then:
Example:

*************************
Sub Macro1()
'
' Macro1 Macro
' Macro
Range("F1").Select
With ActiveWindow
.SplitColumn = 5
.SplitRow = 0
End With
End Sub

or
*******************
Sub Macro2()
'
' Macro2 Macro
'
Range("A10").Select
With ActiveWindow
.SplitColumn = 0
.SplitRow = 9
End With
End Sub


Good Luck!
 
That's cool Oda.............I've never used that feature before. I'm
changing jobs at work next week and going form a workstation with three
monitors to one with only one.........I can see where this feature may be a
big help making the transition ...........thanks for the post

Vaya con Dios,
Chuck, CABGx3



Oda Yujiro said:
Hi! "Bhuktar S >",

I don't understand exactly what you want,
but how about this:
Select any cell, then Windows Menu | Split

Try to select any cell on the very upper row , rightmost row or else,
then split-window.

If you like Macro, then:
Example:

*************************
Sub Macro1()
'
' Macro1 Macro
' Macro
Range("F1").Select
With ActiveWindow
.SplitColumn = 5
.SplitRow = 0
End With
End Sub

or
*******************
Sub Macro2()
'
' Macro2 Macro
'
Range("A10").Select
With ActiveWindow
.SplitColumn = 0
.SplitRow = 9
End With
End Sub


Good Luck!
 
Hi! "CLR" ,
Your very welcome!
It's my pleasure if it can work for you!
Good Luck!
 
Back
Top