Set the window position and size : Application Windows « Application « VBA / Excel / Access / Word

Home
VBA / Excel / Access / Word
1.Access
2.Application
3.Data Type
4.Data Type Functions
5.Date Functions
6.Excel
7.File Path
8.Forms
9.Language Basics
10.Math Functions
11.Outlook
12.PowerPoint
13.String Functions
14.Windows API
15.Word
16.XML
VBA / Excel / Access / Word » Application » Application Windows 




Set the window position and size
 
Sub win()
    Dim myWindow1 As Window, myWindow2 As Window
    Set myWindow1 = ActiveWindow
    Set myWindow2 = myWindow1.NewWindow
    With myWindow1
        .WindowState = xlNormal
        .Top = 0
        .Left = 0
        .Height = Application.UsableHeight
        .Width = Application.UsableWidth * 0.25
    End With
    With myWindow2
        .WindowState = xlNormal
        .Top = 0
        .Left = (Application.UsableWidth * 0.251
        .Height = Application.UsableHeight
        .Width = Application.UsableWidth * 0.75
    End With
End Sub

 














Related examples in the same category
1.Transform all windows into icons
2.Zoom a form
3.Make sure that the scroll bars and status bar are hidden and that the formula bar is displayed:
4.Zooming a Window and Setting Display Options
5.Center application
6.To change the values of the WindowState, Width, and Height properties of the Excel application window, you must explicitly reference the Application object
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.