Eve has attended:
Excel VBA Intro Intermediate course
User Form Windows
Is there a way to control the size of a user form when it opens up on different screen resolutions eg an autofit option? We have had instances where the user form displays fine on a desktop PC but does not fit onto a laptop screen.
RE: User Form Windows
Hi Eve
Thanks for your question
after some playing around I have come up with the following code which seems to do the trick
Private Sub UserForm_Initialize()
With ActiveWindow
.WindowState = xlNormal
.Top = 1
.Left = 1
End With
With Me
.Width = Application.UsableWidth
.Height = Application.UsableHeight
End With
End Sub
I have tried this on different screen resolutions and it seems to work OK.
Regards
Stephen