VBA Split Screen

Pinaceous

Well-known Member
Joined
Jun 11, 2014
Messages
1,113
Office Version
  1. 365
Platform
  1. Windows
Good Day All,

Is there a way to change your split row orientation?

For example,

If I am between rows 1 - 100 the SplitRow will capture the first 3 rows, Rows 1-3 heading.

Now, I'd like the split row orientation to change when I am between rows 101 - 200, where the SplitRow will capture Rows 101 - 103 for its heading.


VBA Code:
    With ActiveWindow
        .SplitColumn = 0
        .SplitRow = 3
    End With

Please let me know.

Thank you!
Pinaceous
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Something like this?
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim where As Long
ActiveWindow.SplitRow = 0
where = Target.Row
where = Int(where / 100) * 100
If Not where = 0 Then
    Application.Goto Me.Range("A" & where), True
    ActiveWindow.SplitRow = 3
Else
    Application.Goto Me.Range("A1"), True
    ActiveWindow.SplitRow = 3
End If
End Sub
 
Upvote 1
Something like this?
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim where As Long
ActiveWindow.SplitRow = 0
where = Target.Row
where = Int(where / 100) * 100
If Not where = 0 Then
    Application.Goto Me.Range("A" & where), True
    ActiveWindow.SplitRow = 3
Else
    Application.Goto Me.Range("A1"), True
    ActiveWindow.SplitRow = 3
End If
End Sub
Nevermind. That's not going to work.
 
Upvote 1
Good Day All,

Is there a way to change your split row orientation?

For example,

If I am between rows 1 - 100 the SplitRow will capture the first 3 rows, Rows 1-3 heading.

Now, I'd like the split row orientation to change when I am between rows 101 - 200, where the SplitRow will capture Rows 101 - 103 for its heading.


VBA Code:
With ActiveWindow
.SplitColumn = 0
.SplitRow = 3
End With
Please let me know.

Thank you!
Pinaceous

Quote Reply
Report
 
Upvote 0

Forum statistics

Threads
1,215,343
Messages
6,124,402
Members
449,156
Latest member
LSchleppi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top