Av8tordude
Well-known Member
- Joined
- Oct 13, 2007
- Messages
- 1,074
- Office Version
- 2019
- Platform
- Windows
I have this code that will center my userform in the center of my screen ( i have 2 monitors). However, i would like to adapt this code to all my userforms, but I don't want to have this code in each userform. i would like to reference the code and call the code from each userform.
VBA Code:
Public Sub Maximize()
With frmToolbar
.StartUpPosition = 0
.Left = Application.Left + (0.5 * Application.Width) - (0.5 * .Width)
.Top = Application.Top + (0.5 * Application.Height) - (0.5 * .Height)
End With
End Sub