Center Pop Up Form

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,341
Office Version
  1. 365
Platform
  1. Windows
I have a form, which I set to Yes. How do I get it to pop up in the center of the screen instead of Top/Left?
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
hi

I use this on my userforms

Me.StartUpPosition = 0
Me.Top = Application.Top + 45
Me.Left = Application.Left + Application.Width - Me.Width - 400

dave
 
Upvote 0
?
Code:
Private Sub Form_Load()
Me.StartUpPosition = 0
Me.Top = Application.Top + 45
Me.Left = Application.Left + Application.Width - Me.Width - 400
End Sub


It doesn't like Me.StartUpPosition = 0
 
Upvote 0
hi

try this in you userform activate code, is it a userform?

Code:
 Top = Application.Top + 130
 Left = Application.Left + Application.Width - Width - 400

You need to adjust the positions accordingly to suit your needs
 
Last edited:
Upvote 0
gheyman, you realize a 'userform' is an Excel form, not an Access form? I ask because as I mentioned elsewhere, you're in the Access part of the forum. The are not the same.
You can try the Docmd.MoveSize method.

PS: I have no idea what this means "which I set to Yes"
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,850
Members
449,051
Latest member
excelquestion515

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