auto-size userforms

  • Thread starter Thread starter john.9.williams
  • Start date Start date
J

john.9.williams

Hi,

Is there a way in which I can auto-size a userform to fit the whole
screen , dependent on moniter size.

regards

John
 
This should maximize de Userform's dimension within Excel Window:

Private Sub UserForm_Initialize()
Me.Height = Application.Height
Me.Width = Application.Width
End Sub

HTH,
 
Hi John,

Try:

'=============>>
Private Sub UserForm_Initialize()
Application.WindowState = xlMaximized
With Application
Me.Top = .Top
Me.Left = .Left
Me.Height = .Height
Me.Width = .Width
End With
End Sub
'<<=============
 
Thanks

This works great, however on one of my forms I have a listbox, I have
added the code to this form, but it makes the form to big, any ideas

John
 
Back
Top