Open Workbook with Multiple Windows

P

pdberger

Good morning --

I've made a workbook for multiple users, in which they'll enter lines of
data and watch accumulators and indices change. As their lines of data
scroll down, I'd like the accumulators (at the top of the sheet) to remain
visible. There are a lot of them, so simply freezing the rows doesn't work.
The best solution is to split the screen into multiple panes. That works
great.

My problem -- when the file opens, I'd like it to do so already split into
the two panes. I can't figure out how to do that.

Any help would be appreciated.

TIA
 
T

Tom Hutchins

Paste this code into the ThisWorkbook module of your workbook:

Private Sub Workbook_Open()
'Make the sheet to be split the active sheet
ThisWorkbook.Sheets("Sheet1").Activate
'Split the window.
With ActiveWindow
.SplitColumn = 0
.SplitRow = 14
End With
End Sub

The numbers after SplitColumn and SplitRow are the column and row numbers
where the window should be split. Setting either to zero (as SplitColumn is
in the example above) means the window won't be split along that dimension.

Change the sheet name and the numbers for SplitColumn and SplitRow as
appropriate. If you are new to macros, this link to Jon Peltier's site may be
helpful:
http://peltiertech.com/WordPress/2008/03/09/how-to-use-someone-elses-macro/

Hope this helps,

Hutch
 
P

pdberger

Thanks very much. Didn't think of a macro, because earlier versions of a
spreadsheet program (Excel, Lotus, Javelin?) used to do this.

Much appreciated.
 
T

Tom Hutchins

You're welcome. Of course, if you save the workbook with the windows split,
it should have the same settings when you next open it.

Hutch
 
P

pdberger

That's what I thought, but it doesn't. I wonder if I have a setting
somewhere that's preventing that...

Peter
 
P

pdberger

Tom --

I ran into a problem. The split works fine, but the two halves of the
workbook scroll along with each other. What I need is for one of them to
remain static while the other scrolls up and down. That's why I tried a
second window.

You were correct that, if I save the workbook with two windows, it'll reopen
with them. However if, in the meantime, I the user opens a different
workbook and maximizes the worksheet area, then this workbook reopens with
only one window.

TIA.
 

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

Top