Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Set a minimum row height a the same time with autofit row height Julie B New Users to Excel 2 May 5th 23 07:44 PM
Row Height stopped growing and Auot-Fit Row Height does not work PSULionRP Excel Discussion (Misc queries) 0 May 19th 09 07:59 PM
Selection.width / .height / .left / .top from cell refor userform JB2010 Excel Programming 6 March 7th 07 05:50 PM
Resizing row height to dynamically fit height of text box Jon Excel Discussion (Misc queries) 1 August 8th 05 01:37 PM
.AddShape(Type, Left, Top, Width, Height) AA2e72E Excel Programming 2 February 2nd 05 01:56 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"