Answers for "excel vba center userform on screen"

VBA
0

excel vba center userform

' On application window
Private Sub UserForm_Initialize() 
   Me.Top = Application.Top + (Application.UsableHeight / 2) - (Me.Height / 2) 
   Me.Left = Application.Left + (Application.UsableWidth / 2) - (Me.Width / 2) 
End Sub 
' Or
With myForm
    .StartUpPosition = 0	' Manual
    .StartUpPosition = 1	' CenterOwner	
    .StartUpPosition = 2	' CenterScreen
    .StartUpPosition = 3	' WindowsDefault, screen top left
End With
Posted by: Guest on February-07-2021

Code answers related to "VBA"

Browse Popular Code Answers by Language