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





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.25) + 1
        .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