ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Controlling xlTiled windows arrangement (https://www.excelbanter.com/excel-programming/453140-controlling-xltiled-windows-arrangement.html)

Walter Briscoe

Controlling xlTiled windows arrangement
 
I have a new machine using xl2007 on Windows 10.
I believe what I have observed also applies to xl2003 on Vista,
but have not tested it
I have windows with captions:
busroutes.xls;1, busroutes.xls;2
busroutesR.xls;1, busroutesR.xls;2

by default Windows.Arrange ArrangeStyle:=xlTiled arranges
busroutesR.xls;2 busroutes.xls;1
busroutesR.xls;1 busroutes.xls;2

i.e. the windows are arranged with corresponding windows in diagonally
opposite positions.
I want to have the following arrangement:
busroutes.xls;1 busroutes.xls;2
busroutesR.xls;1 busroutesR.xls;2

The following code seems to do what I want:
Windows.Arrange ArrangeStyle:=xlCascade
Windows("busroutesR.xls;2").Activate
Windows("busroutes.xls;2").Activate
Windows("busroutesR.xls;1").Activate
Windows("busroutes.xls;1").Activate
Windows.Arrange ArrangeStyle:=xlTiled

After running the code the following shows what is happening in the
cttl+G debug pane:
for each x in windows: debug.Print x.caption:next
busroutes.xls;1
busroutesR.xls;1
busroutes.xls;2
busroutesR.xls;2
PERSONAL.XLSB

I.e., xlTiled places windows in vertical order first.

I failed to find this subject with Google.
I hope my discovery is interesting.
I hope more information and/or a better method will be volunteered. ;)
--
Walter Briscoe


All times are GMT +1. The time now is 04:04 AM.

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