Split Panes Vertical Scroll Bar

ChristineJ

Well-known Member
Joined
May 18, 2009
Messages
762
Office Version
  1. 365
Platform
  1. Windows
I have used split panes to show two copies of my screen side by side/left and right. There are already two horizontal scroll bars on the bottom - one on each pane. There is only one vertical scroll bar on the right side of the right pane. Two questions:

1. Can a VERTICAL scroll bar be added to the right side the left pane so that each pane can independently be scrolled up and down without the other pane scrolling simultaneously?

1. Is there a way to remove these HORIZONTAL scroll bars on the bottom?

Thanks! (My first post...)
 
This is working better than I thought it could! Could I please ask one more question?

Is it possible for each window to with a different cell in the upper left-hand corner? For example, the top window would open at A1, the bottom left would open at A20, and the bottom right would open at H30.
 
Upvote 0

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
This is working better than I thought it could! Could I please ask one more question?

Is it possible for each window to with a different cell in the upper left-hand corner? For example, the top window would open at A1, the bottom left would open at A20, and the bottom right would open at H30.
 
Upvote 0
I'm glad it helped.

I'm just leaving and could not test this properly but try:

Code:
Private Sub Worksheet_Activate()
Dim wd As Double, ht As Double
 
    wd = Application.UsableWidth
    ht = Application.UsableHeight
 
    With ActiveWindow
        .WindowState = xlNormal
        .Left = 0
        .Top = 0
        .Width = wd
        .Height = ht / 3
[COLOR=red]        Application.Goto Range("A1"), Scroll:=True[/COLOR]
    End With
 
    With ActiveWindow.NewWindow
        .Left = 0
        .Top = ht / 3
        .Width = wd / 2
        .Height = ht * 2 / 3
[COLOR=red]        Application.Goto Range("A20"), Scroll:=True[/COLOR]
    End With
 
    With ActiveWindow.NewWindow
        .Left = wd / 2
        .Top = ht / 3
        .Width = wd / 2
        .Height = ht * 2 / 3
[COLOR=red]        Application.Goto Range("H30"), Scroll:=True[/COLOR]
    End With
 
End Sub
 
Last edited:
Upvote 0
pgc01 -

I have been using the code you provided for me on December 15th to split a screen into three windows very successfully - thanks!

One additional question, if you don't mind, having to do with closing the windows or the entire file. Right now if I close one window, the other two stay open. If I close the next one, the last one is still open. In other words, I have to close each window separately. Likewise, if I close the file, it only closes one window first.

Is it possible to add to this code so that if one window is closed by clicking the X in the upper right-hand corner they ALL close at once? AND if the X for the file is clicked, all three windows close simultaneously?

Thanks again! Chris
 
Upvote 0
I've been using the code in post #13 of this thread to split screens with scrollbars. Each of the three split panes has its own minimize, restore, and close buttons at the top right. Is it possible to add code to disable these buttons so users cannot close (most importantly) or resize any of these smaller screens?
 
Upvote 0
Hi Chistine

You can disable changes in the workbook structure, that will get rid of the buttons:

Code:
    ActiveWorkbook.Protect Structure:=True, Windows:=True

You can later on restore them:

Code:
    ActiveWorkbook.Unprotect

Remark: as you can see I did not use a password, but you can add it if you want.
 
Upvote 0
Hallo

I humbly ask help in the forum for all employees to improve and evaluate the following code.

The code hides the title bar, so if dropped on each box hides the controls, since it is a wonder to my process "it can determine whether problems in the various versions tested on Excel 2003.

---------------------------------------------------------------
Module1
Code:
Dim oFormChanger As New Classe1

Sub TitleStrips()
    Set oFormChanger.Form = ActiveWorkbook
End Sub
Module Classe1

Code:
Option Explicit

Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function apiGetFocus Lib "user32" Alias "GetFocus" () As Long

Dim hWndForm As Long

Public Property Set Form(oForm As Object)
    hWndForm = apiGetFocus
    SetWindowLong hWndForm, -16, GetWindowLong(hWndForm, -16) And Not &HC00000
End Property
 
Upvote 0
Thanks, pgc01. It works and does exactly what I need. However, I put it at the end of the split screen code, and that is obviously not where it goes since it is creating all sorts of other errors that were not there previously.

Where should I paste in that code?

Many thanks for your patience. Chris
 
Upvote 0
Hi

I don't know your present code and so I used the last code I posted.

I added the 2 statements to the Event procedures:

Code:
Option Explicit
Private Sub Worksheet_Activate()
Dim wd As Double, ht As Double
 
    wd = Application.UsableWidth
    ht = Application.UsableHeight
 
    With ActiveWindow
        .WindowState = xlNormal
        .Left = 0
        .Top = 0
        .Width = wd
        .Height = ht / 3
        Application.Goto Range("A1"), Scroll:=True
    End With
 
    With ActiveWindow.NewWindow
        .Left = 0
        .Top = ht / 3
        .Width = wd / 2
        .Height = ht * 2 / 3
        Application.Goto Range("A20"), Scroll:=True
    End With
 
    With ActiveWindow.NewWindow
        .Left = wd / 2
        .Top = ht / 3
        .Width = wd / 2
        .Height = ht * 2 / 3
        Application.Goto Range("H30"), Scroll:=True
    End With
    
[COLOR=red]    ActiveWorkbook.Protect Structure:=True, Windows:=True
[/COLOR] 
End Sub
 
Private Sub Worksheet_Deactivate()
Dim ws As Worksheet
 
[COLOR=red]    ActiveWorkbook.Unprotect
[/COLOR]
    Set ws = ActiveSheet
    ActiveWindow.Close
    ActiveWindow.Close
    Application.EnableEvents = False
    ws.Activate
    Application.EnableEvents = True
    ActiveWindow.WindowState = xlMaximized
End Sub

Please test.
 
Upvote 0

Forum statistics

Threads
1,216,110
Messages
6,128,896
Members
449,477
Latest member
panjongshing

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