logo
search
VBA & Macro Problems

How to Center a VBA UserForm Across Multiple Monitors

WPS EditorWPS Editor Oct 1, 2026 870 views

Question details

The user needs to correctly center a VBA UserForm when using multiple displays with different settings.

How to Center a VBA UserForm Across Multiple Monitors
Product
Spreadsheets
Device & OS
not provided
Scenario
Moving a VBA UserForm between a laptop display and an external monitor.
Observed behavior
The UserForm appears off-center or contains excessive blank space when moved between screens.
Before you start

Verify that your external monitor and laptop display scaling settings are configured correctly, as mismatched DPI scaling between two displays is the most common cause of off-center UserForms.

Solution 1Recommended

Adjust the UserForm StartUpPosition Property

Use the built-in VBA properties to force the UserForm to center relative to the active application window rather than the primary screen.

1
Open the Visual Basic Editor

Press Alt + F11 to launch the VBA Editor in your spreadsheet application.

2
Select the Target UserForm

In the Project Explorer pane on the left, locate and click on the UserForm you want to center.

3
Open the Properties Window

Press F4 to display the Properties window for the selected UserForm.

4
Change StartUpPosition

Locate the StartUpPosition property and change its value to '1 - CenterOwner'. This ensures the form centers within the application window, regardless of which monitor the application is currently occupying.

Adjust the UserForm StartUpPosition Property
Application Positioning: Using '1 - CenterOwner' is generally more reliable for multi-monitor setups than '2 - CenterScreen', which often locks the UserForm to the primary monitor.
Advanced VBA Support

Seamlessly Run and Edit VBA Macros in WPS Office

WPS Office provides robust support for VBA and macros. You can design, edit, and accurately position UserForms across multiple monitors just as you would in other spreadsheet software, but within a highly efficient application.

  1. 1. Enable Developer Tools: Open WPS Spreadsheets, navigate to the Options menu, and ensure the Developer tab is enabled in your ribbon layout.
  2. 2. Launch the VBA Editor: Click the Developer tab and select 'Visual Basic', or press Alt + F11, to open the built-in VBA editor.
  3. 3. Customize Your UserForm: Insert a new UserForm, adjust the StartUpPosition property to CenterOwner, and test it across your external monitors seamlessly.
Full support for VBA UserForms and macro executionSeamless multi-monitor display handling and centeringComplete compatibility with Microsoft Excel (.xlsm and .xlsb) formatsLightweight application with intuitive developer tools
microsoft office alternative - wps office

Frequently Asked Questions

Why does my VBA UserForm shrink when moved to another monitor?

This occurs due to DPI (Dots Per Inch) scaling differences between your monitors. When moving a UserForm from a high-DPI laptop screen to a standard external monitor, the system attempts to rescale it, which can cause internal elements to shrink or appear distorted.

What is the difference between CenterScreen and CenterOwner in VBA?

CenterScreen (StartUpPosition = 2) places the UserForm in the middle of the primary monitor, regardless of where the application window is located. CenterOwner (StartUpPosition = 1) places the UserForm in the middle of the active application window, making it the ideal setting for multi-monitor setups.

How do I fix excessive blank space inside my UserForm?

Excessive blank space often happens when the UserForm's external dimensions scale up, but the internal controls remain at their original coordinates. Ensuring uniform DPI scaling across your displays in Windows Settings, or using a dynamic resizing macro in the UserForm_Initialize event, will resolve this layout issue.

Do these VBA scaling issues occur in WPS Office?

WPS Office fully supports VBA macros and respects standard system scaling rules. If your UserForm is configured with the correct StartUpPosition (such as CenterOwner) and your monitors are configured properly, it will center seamlessly in WPS Office across multiple screens.