View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JMay JMay is offline
external usenet poster
 
Posts: 422
Default userform to appear in the center of the screen

The following code needs to be pasted into the Code
Behind your Userform:

Private Sub UserForm_Initialize()
Me.Left = Application.Width / 2 - Me.Width / 2
Me.Top = Application.Height / 2 - Me.Height / 2
End Sub

Write back if you encounter problems;

Jim

"ernie" wrote in message
:

how can i get my userform to appear in the center of the screen even if i
change my screen resolution settings. i use the code below with screen
resolution of 1024 by 768 pixels.

Private Sub Workbook_Open()
Application.WindowState = xlNormal
Application.Top = 250
Application.Left = 320
Application.Height = 1
Application.Width = 1
End Sub
--
Thank you for your help i appreciate it.
Ernie