ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to change windows.arrange from xlTiled to xlHorizontal and back in one procedure (https://www.excelbanter.com/excel-programming/317949-how-change-windows-arrange-xltiled-xlhorizontal-back-one-procedure.html)

Zdenek Moravec

How to change windows.arrange from xlTiled to xlHorizontal and back in one procedure
 
I want to create one button, which changes arranging the windows on
the screen from maximized status to tiled, by next clicking from tiled
to horizontal, by next clicking from horizontal back to maximized.
I don't know, how to get ArrangeStyle value to set the next one in one
procedure.
Thank you
Zdenek Moravec
Panasonic AVC Networks Czech

Dick Kusleika[_4_]

How to change windows.arrange from xlTiled to xlHorizontal and back in one procedure
 
Zdenek

I don't either. You'd think that would be a property of Application or
Windows, but I sure can't find it. You could use a module level variable as
a workaround.

Dim lWndState As Long

Sub SwitchView()

Select Case lWndState
Case xlMaximized
Windows.Arrange xlArrangeStyleTiled
lWndState = xlArrangeStyleTiled
Case xlArrangeStyleTiled
Windows.Arrange xlArrangeStyleHorizontal
lWndState = xlArrangeStyleHorizontal
Case Else
ActiveWindow.WindowState = xlMaximized
lWndState = xlMaximized
End Select

End Sub

--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com

Zdenek Moravec wrote:
I want to create one button, which changes arranging the windows on
the screen from maximized status to tiled, by next clicking from tiled
to horizontal, by next clicking from horizontal back to maximized.
I don't know, how to get ArrangeStyle value to set the next one in one
procedure.
Thank you
Zdenek Moravec
Panasonic AVC Networks Czech




[email protected]

How to change windows.arrange from xlTiled to xlHorizontal and back in one procedure
 
Hello Dick
This is exactly, what I need.
Thank you
Zdenek Moravec



All times are GMT +1. The time now is 10:56 PM.

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