StartUp Position UserForm

A UserForm object has a property named StartUpPosition. By default, this property is set to 1 (CenterOwner), which means that it should appear in the center of Excel's window. In Excel for Windows this is working correct if you use one screen but not in Mac Excel. And if you use dual monitors this will not work correct in Excel for Windows and on a Mac.

On a Mac we have another problem because setting StartUpPosition to 1 will not work like in Windows
because it will center on your Mac and not in center of the Excel window, and also you have the same problem as in win Excel if you have more screens attached to your Mac.

Excel 2016 or higher

The code below will open a UserForm named UserForm1 and will work in Win and Mac Excel. The code for Mac and Windows are not the same for setting the top position of the UserForm because of a bug in Application.Top in Mac Office, see the two code blocks in the macro.

Bug when you use two screens attached to your Mac

If you have Excel open on your second screen and open a UserForm with a combobox you will notice that the combobox will open on the right side of your first screen if you click on the down arrow. This is a known problem but because of other high priority things in Mac Office we must not think this will be fixed soon.
05/09/2024
Web design by Will Woodgate