Positioning a Userform

User avatar
Don Wells
5StarLounger
Posts: 689
Joined: 27 Jan 2010, 16:45
Location: Ottawa, Ontario, Canada

Positioning a Userform

Post by Don Wells »

Earlier today I came across values which would set the startup position of a userform when shown. I can see only four options. Is anyone aware of a technique which will position the userform in the bottom left corner of the screen?
     :help:
T.I.A.
Regards
Don

Becks
2StarLounger
Posts: 196
Joined: 31 Mar 2011, 03:41
Location: Perth, Western Australia

Re: Positioning a Userform

Post by Becks »

First, set form's StartUpPosition to Manual (0)
then

Code: Select all

Private Sub UserForm_Initialize()
     With Application
        Me.Left = .Left + .Width - Me.Width
        Me.Top = .Top + .Height - Me.Height
    End With
End Sub
Kevin

User avatar
Don Wells
5StarLounger
Posts: 689
Joined: 27 Jan 2010, 16:45
Location: Ottawa, Ontario, Canada

Re: Positioning a Userform

Post by Don Wells »

Becks wrote:First, set form's StartUpPosition to Manual (0)
then

Code: Select all

Private Sub UserForm_Initialize()
     With Application
        Me.Left = .Left + .Width - Me.Width
        Me.Top = .Top + .Height - Me.Height
    End With
End Sub
Kevin
Thanks for the insight Kevin.    That gave me the bottom right.    I got the bottom left with:

Code: Select all

Me.Left = .Left
:thankyou:
Regards
Don

Becks
2StarLounger
Posts: 196
Joined: 31 Mar 2011, 03:41
Location: Perth, Western Australia

Re: Positioning a Userform

Post by Becks »

:blush: Left ? :scratch:

You really wanted it on the bottom RIGHT - I could tell :evilgrin:
(it makes for more instructive code)

Kevin