Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default How can I Center a Dialog Box each time a user opens it?

Bandit, if you're talking about a userform, follow these steps:
1. Display the userform in the VBA editor
2. Display the userform properties.
3. In the userform properties, set Startup Position to manual.
4. Copy this code and paste to your userform module:

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

James

Bandit wrote:
I have a custom dialog box with dropdrowns etc used to select options.
Each time you click the command buttion that shows the dialog box the box
moves towards the upper left corner of the worksheet? How can I center the
dialog each time it is shown?. Are there methods to control the position of a
dialog using VBA or other means?


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
Properties dialog box opens instead of a workbook Daniel Forthman Excel Discussion (Misc queries) 1 August 14th 07 02:52 PM
When opening a workbook, need to ensure user opens in a certain ce Gover Excel Discussion (Misc queries) 4 April 11th 07 03:06 PM
Center text in dialog box Raza Excel Worksheet Functions 1 December 5th 05 08:34 PM
using Windows API Open Dialog/Browse in VBA - center form in scree Philip Excel Programming 1 April 19th 05 02:15 PM
How can I program a message box to open when a user opens and exc. Marcus Excel Programming 1 February 16th 05 04:12 AM


All times are GMT +1. The time now is 09:15 PM.

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

About Us

"It's about Microsoft Excel"