user form windows

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » User Form Windows

User Form Windows

resolvedResolved · Low Priority · Version 2007

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

Mon 29 Mar 2010: Automatically marked as resolved.

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Cycling through Absoulte cell references

If you are working with formulas in excel and need to convert your formula to an absolute formula, instead on manually adding in the $dollar signs you can highlight the specific part of your formula and press the F4 key.

You can cycle through all the absolute options by pressing the button (up to four times)

View all Excel hints and tips


Server loaded in 0.07 secs.