Launch userform on specific monitor

HOGAN2023

New Member
Joined
Nov 8, 2023
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hello,

I use 3 monitors in Windows extended desktop configuration (2x 24" and 1x 15" laptop screen).

I'd like to be able to choose the monitor on which my userform will be launched in full screen mode.

A listbox or 3 buttons named respectively "Monitor 1", "Monitor 2" or "Monitor 3" can do the trick.

I tried but failed with the solutions proposed by @Handyman84 and @Jaafar Tribak on this post : New window, move to second screen (using VBA).


Another solution would be to move the userform on the monitor where you want it to launch in full screen mode.
But how do you do this?


I'd really appreciate your help 🙏

Thank you very much.
Vincent
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
This is untried here because I have only a single monitor. See if it works for you :

VBA Code:
Sub Launch_UserForm()
'--Addresses Dual Screen problem by launching Userform in Maximized Application
'  --TopLeft position saved in Userform Properties at Design Time are used
'  --in relation to Maximized Application

    Dim lDsnLeft As Long, lDsnTop As Long
    
    With Application
        If .WindowState <> xlMaximized Then _
            .WindowState = xlMaximized
    End With
    
    With UserForm1
        '---Read UserForm Settings saved at Design Time
        lDsnLeft = .Left
        lDsnTop = .Top
      
        .StartUpPosition = 0
        .Left = Application.Left + lDsnLeft
        .Top = Application.Top + lDsnTop
        .Show
    End With
End Sub

There is additional resource code at : Userform shows up on the wrong monitor
 
Upvote 0
This is untried here because I have only a single monitor. See if it works for you :

VBA Code:
Sub Launch_UserForm()
'--Addresses Dual Screen problem by launching Userform in Maximized Application
'  --TopLeft position saved in Userform Properties at Design Time are used
'  --in relation to Maximized Application

    Dim lDsnLeft As Long, lDsnTop As Long
   
    With Application
        If .WindowState <> xlMaximized Then _
            .WindowState = xlMaximized
    End With
   
    With UserForm1
        '---Read UserForm Settings saved at Design Time
        lDsnLeft = .Left
        lDsnTop = .Top
     
        .StartUpPosition = 0
        .Left = Application.Left + lDsnLeft
        .Top = Application.Top + lDsnTop
        .Show
    End With
End Sub

There is additional resource code at : Userform shows up on the wrong monitor
Don't work unfortunately
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,187
Members
452,616
Latest member
intern444

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