ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   auto-size userforms (https://www.excelbanter.com/excel-programming/353782-auto-size-userforms.html)

[email protected]

auto-size userforms
 
Hi,

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

regards

John


Ardus Petus

auto-size userforms
 
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,

--
AP

a écrit dans le message de
ups.com...
Hi,

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

regards

John




Norman Jones

auto-size userforms
 
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
'<<=============


---
Regards,
Norman



wrote in message
ups.com...
Hi,

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

regards

John




[email protected]

auto-size userforms
 
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


[email protected]

auto-size userforms
 
Forget the last post I have sorted it now, thanks guys great advice

John



All times are GMT +1. The time now is 12:03 AM.

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