
There is one final wrinkle, which is that this button doesn’t appear by default in the Excel 2003 “Window” toolbar. This leads to a one-line function that checks that button’s status using its ID of 7874. This button is only enabled when View Side by Side is active.
Chip pearson excel keyboard shortcuts code#
This code only responds to resizes involving the two horizontal borders in the middle, as well as the right-hand borders. LowerWindow.Height = LowerWindow.Height - LowerWindowChange LowerWindowChange = LowerWindow.Top - OldLowerWindowTop LowerWindow.Top = UpperWindow.Top + UpperWindow.Height If ActiveWindow.Caption = UpperWindow.Caption Then

'but in Excel 2013 each window is its own Application 'for Excel 2010 could just use Application.Height 'easy way to deal with heights less than zero, etc. Private Sub app_WindowResize( ByVal Wb As Workbook, ByVal Wn As Window) 'application-level event in a class module Public WithEvents app As Excel.Application
Chip pearson excel keyboard shortcuts windows#
After all we’re just resizing windows here, and it’s easier than testing for odd things like heights less than zero: You’ll also note that I used On Error Resume Next more freely than normally. This means the code needs to store the lower windows top location before resizing it. The 2013 tweaks were a little trickier, because Application.Height returned the same thing as Window.Height in 2013. It’s designed to work in Excel 2010 (and 2007, although untested) as well as 2013. It uses a function to test whether View Side by Side is active. The code I came up with is in an application-level event.

You can see that it needs to be followed up with some more fiddling to snug the lower window up against the upper one: I also noticed some issues with View Side by Side in Excel 2013.īelow is a screenshot of what happens when you resize a window in View Side by Side. The most important to this code was figuring out how tell if View Side by Side is activated.

This weekend I set about tweaking View Side by Side to adjust one window when the other is resized.Īlong the way I learned a few interesting things. I often make one smaller and then adjust the second to have it fill the rest of the screen. That means I spend a bit of time fiddling with the two windows because I don’t always want each to take up half the space.
