UserForm Display Location

cicconmr

Board Regular
Joined
Jul 5, 2011
Messages
90
Pretty simple: My UserForm is displaying in a random location, and since this workbook is going to go out to clients, I'd like to have the UserForm display in the middle of their screen each time it is shown.

Is there a way to force it to do that? Right now, my user form is displaying in the monitor right of the monitor my Excel is open in which makes no sense....(I have three monitors, I run excel in the middle, the UserForm shows up in my far right one)

Any one encountered this problem or have a solution?
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Yep, I get this when using multiple monitors

Use userform.Top and userform.Left to set the positions. You can store these values in variables when the form is moved, using the userform_layout event, and then recall them when needed - so the form will reopen wherever it last was
 
Upvote 0
Hey I don't mean to sound daft but how exactly can I do this. Can I just set Userform.Top = some parameter and same with userForm.Left?

Sorry I didn't quite understand...
 
Upvote 0
Your userform has properties, these are displayed in the Properties window of the VB Editor

Any of these properties can be set in the properties window - which sounds like what you want to do - and also adjusted in your code, such as when using the Userform_Initialize event

Try adding the following code to your userform:
Code:
Private Sub UserForm_Layout()
Application.StatusBar = "top= " & UserForm1.Top & ", left = " & UserForm1.Left
End Sub
This will show you how the top and left parameters vary as you move your form around. You will need to type "application.statusbar = false" into the immediate window when you are finished playing with this
 
Upvote 0
I believe it is measured in Twips, but I can't tell you how the value varies on different types of screen size combinations, sorry
 
Upvote 0

Forum statistics

Threads
1,224,585
Messages
6,179,706
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top