Hi
Can anyone help with the following. I have a User Form which I would like to centre (on opening) on one of my two monitors.
I have found the following code (which runs on user form initialising)
Private Sub UserForm_Initialize()
With GenAvailInputForm
Me.StartUpPosition = 0
Me.Left = Application.Left + (0.5 * Application.Width) - (0.5 * .Width)
Me.Top = Application.Top + (0.5 * Application.Height) - (0.5 * .Height)
Me.Show
End With
End Sub
It seems to work but when I close the form on the disable button I get the following message
Run-Time error '91'
Object Variable or With Block Variable not set
I'm a bit of a novice so any help would be appreciated
Thanks
Can anyone help with the following. I have a User Form which I would like to centre (on opening) on one of my two monitors.
I have found the following code (which runs on user form initialising)
Private Sub UserForm_Initialize()
With GenAvailInputForm
Me.StartUpPosition = 0
Me.Left = Application.Left + (0.5 * Application.Width) - (0.5 * .Width)
Me.Top = Application.Top + (0.5 * Application.Height) - (0.5 * .Height)
Me.Show
End With
End Sub
It seems to work but when I close the form on the disable button I get the following message
Run-Time error '91'
Object Variable or With Block Variable not set
I'm a bit of a novice so any help would be appreciated
Thanks