Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Center Comments on Center of Screen Raymond W. Excel Discussion (Misc queries) 5 September 15th 09 04:58 PM
userform to appear in the center of the screen JLGWhiz Excel Programming 1 December 28th 06 05:50 AM
How do you keep a Dialog Box in the center of the screen? NickHK Excel Programming 0 December 7th 06 02:40 AM
How do i center a worksheet in the view screen midnightyell Excel Discussion (Misc queries) 0 April 5th 05 07:03 PM
UserForm position other than center of the screen. Jay Fincannon Excel Programming 1 January 23rd 05 02:23 AM


All times are GMT +1. The time now is 03:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"