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.

For Excel 2016 or higher, Mac and Win

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.

26/01/2025
Web design by Will Woodgate