UserForm On Launch Position - Lower Right Corner

ranouilh

New Member
Joined
Apr 26, 2005
Messages
16
I need a VBA comand to place a UserForm at the lower right corned of the screen when the form is called. It will need to work for different systems with different screen resolutions. Not sure if this exists and I could not find it if it does.
Thanks in advance to all who help with this.
 

Some videos you may like

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

smozgur

BatCoder
Joined
Feb 28, 2002
Messages
1,209
Hi,

Following code might help as well.

Code:
Private Sub UserForm_Initialize()
Dim tmpStatus As Long
  With Application
    tmpStatus = .WindowState
    .ScreenUpdating = False
    .WindowState = xlMaximized
    Me.StartUpPosition = 0 
    Me.Move .Width - Me.Width, .Height - Me.Height
    .WindowState = tmpStatus
    .ScreenUpdating = True
  End With
End Sub

You can remove "Me.StartUpPosition = 0" code line if you set userform StartupPosition as Manual in properties window.

Suat
 

Watch MrExcel Video

Forum statistics

Threads
1,118,110
Messages
5,570,250
Members
412,313
Latest member
pauloalex
Top