Resize and position excel window
Hi Macroapa
The code below should do what you want, it will set the width and
height to 75% of the full screen size but you can change this to an %
you want.
Option Explicit
Dim oldHeight, oldWidth As Long
Dim newHeight, newWidth As Long
Private Sub CommandButton1_Click()
With Application
oldHeight = .Height
oldWidth = .Width
newHeight = oldHeight / 100 * 75
newWidth = oldWidth / 100 * 75
.WindowState = xlNormal
.Height = newHeight
.Width = newWidth
.Top = 0
.Left = oldWidth - newWidth - 3
End With
Hope this helps
Steve
|