![]() |
Detect top, left & height of activeworkbook? How do?
Anyone know how to detect the position (top, left & ht) of a given
open workbook? I am trying to show all open workbooks in a flowing style so I can see them all. I know that the cascade style position exists but I want to have more control over the position of each of these open workbooks so I can see them better. Thanks, Chet |
Detect top, left & height of activeworkbook? How do?
Try something like this -
Sub Cascader() Dim cnt As Long, i As Long, n As Long Dim w As Single, h As Single Dim wn As Window Application.ScreenUpdating = False Application.WindowState = xlMaximized With ActiveWindow .WindowState = xlMaximized w = .Width - 6 h = .Height - 24 End With ReDim saNames(1 To Application.Windows.Count) With Application.Windows For i = 1 To .Count With .Item(i) If .Visible Then cnt = cnt + 1 saNames(cnt) = .Caption End If End With Next End With Application.EnableEvents = False With Application.Windows For i = cnt To 1 Step -1 Set wn = .Item(saNames(i)) With wn .WindowState = xlNormal .Activate .Left = n * 21 + 3 .Top = n * 24 + 3 .Width = w - .Left .Height = h - .Top - 3 If .Top h * 0.7 Then n = 0 End With n = n + 1 Next End With Application.ScreenUpdating = True Application.EnableEvents = True End Sub Regards, Peter T "Chet" wrote in message ... Anyone know how to detect the position (top, left & ht) of a given open workbook? I am trying to show all open workbooks in a flowing style so I can see them all. I know that the cascade style position exists but I want to have more control over the position of each of these open workbooks so I can see them better. Thanks, Chet |
All times are GMT +1. The time now is 10:11 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com