ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel VBA - Automatic adjusting of 2 windows (https://www.excelbanter.com/excel-programming/290064-excel-vba-automatic-adjusting-2-windows.html)

Geo Siggy

Excel VBA - Automatic adjusting of 2 windows
 
My Excel application is splitted into two horizontal windows (not
panes), the one above is a diagram with fixed size in height. The one
below is a normal calculation sheet. The problem is how to program in
VBA, that the window below always will fill the remaining space of the
Excel spreadsheet (the remaining space is depending of the monitor,
resolution, the chosen toolbars etc).

Thanx Siggy


---
Message posted from http://www.ExcelForum.com/


John McGimpsey

Excel VBA - Automatic adjusting of 2 windows
 
one way:

Const nWINDOW1HEIGHT = 300 'change to suit
If Windows.Count < 2 Then Exit Sub
With Windows(1)
.Top = 0
.Width = Application.UsableWidth
.Height = nWINDOW1HEIGHT
End With
With Windows(2)
.Top = nWINDOW1HEIGHT + 1
.Width = Application.UsableWidth
.Height = Application.UsableHeight - nWINDOW1HEIGHT
End With


In article ,
Geo Siggy wrote:

My Excel application is splitted into two horizontal windows (not
panes), the one above is a diagram with fixed size in height. The one
below is a normal calculation sheet. The problem is how to program in
VBA, that the window below always will fill the remaining space of the
Excel spreadsheet (the remaining space is depending of the monitor,
resolution, the chosen toolbars etc).


Geo Siggy[_2_]

Excel VBA - Automatic adjusting of 2 windows
 
Okay thats it. Thanks to John McGimpsey. Siggy


---
Message posted from http://www.ExcelForum.com/



All times are GMT +1. The time now is 05:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com