The following code will center the userform in Excel's window:
Code:With UserForm1 .StartUpPosition = 0 .Left = Application.Left + (0.5 * Application.Width) - (0.5 * .Width) .Top = Application.Top + (0.5 * Application.Height) - (0.5 * .Height) .Show End With
The following code will center the userform in Excel's window:
Code:With UserForm1 .StartUpPosition = 0 .Left = Application.Left + (0.5 * Application.Width) - (0.5 * .Width) .Top = Application.Top + (0.5 * Application.Height) - (0.5 * .Height) .Show End With </PRE>
I run two monitors at work and just tested the code, works like a charm. Not sure why it doesn't work for dinotom. Anyway, thanks mthompso.
I run two monitors at work and just tested the code, works like a charm. Not sure why it doesn't work for dinotom. Anyway, thanks mthompso.
The following code will center the userform in Excel's window:
Code:With UserForm1 .StartUpPosition = 0 .Left = Application.Left + (0.5 * Application.Width) - (0.5 * .Width) .Top = Application.Top + (0.5 * Application.Height) - (0.5 * .Height) .Show End With