+ Reply to Thread
Results 1 to 9 of 9

Controlling Location Userform Opens

  1. #1
    Registered User
    Join Date
    08-27-2008
    Location
    United States
    Posts
    45

    Controlling Location Userform Opens

    Is there any way to control where a Userform opens (on the screen I mean)?

    Using dual monitors causes my userforms to open at somewhat weird locations, sporadicly, (at least I think this is why this happens, when they move from center they always align on the dividing line between screens) and I am wondering if I can specify somehow that I want them to open centered in the middle of the Excel document controlling them always.

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573
    The default is to use the Userform's property, StartupPosition, as 1. You must have it set to 2.

    Select the userform in the projects and press F4 to view and edit the userform's property at design time.

  3. #3
    Registered User
    Join Date
    08-27-2008
    Location
    United States
    Posts
    45
    It is listed as 1

  4. #4
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573
    Try changing it to 2, see how that plays and then back to 1 and play again.

    Here is an example. The MsgBox should show in the center of the screen and the Userform in the center of Excel.
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    Also, you can select manual, then play around with locations until you are happy. The userform has two properties that can help you: TOP, and LEFT.

    Try changing these numbers to see where you want to have the userform start. For example, a TOP value of 100 and a LEFT value of 300 will start the userform in the middle of the page and towards the top. Give it a try.

  6. #6
    Registered User
    Join Date
    08-27-2008
    Location
    United States
    Posts
    45
    Quote Originally Posted by Kenneth Hobson View Post
    Try changing it to 2, see how that plays and then back to 1 and play again.

    Here is an example. The MsgBox should show in the center of the screen and the Userform in the center of Excel.
    Is there any way that showing/hiding a userform will somehow cause this?

    All my userforms have their settings as "1" and I changed them all to "2" and back; no difference.

  7. #7
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573
    No. Hiding will make no difference.

    Did you try the one that I posted? You can attach yours if you like.

    You can also try setting the Top and Left properties as BigBas suggested.

  8. #8
    Registered User
    Join Date
    08-27-2008
    Location
    United States
    Posts
    45
    Quote Originally Posted by Kenneth Hobson View Post
    No. Hiding will make no difference.

    Did you try the one that I posted? You can attach yours if you like.

    You can also try setting the Top and Left properties as BigBas suggested.

    I did try your workbook, but couldn't duplicate my error :-\

    The top/left still caused it to have the same thing.

    I think I found out why it was happening; I moved all my open excel documents as well as the editor into the same screen of my setup (instead of having the workbook open in one screen and the editor in the other) and the problem stopped occurring.

    Should that make a difference?

  9. #9
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573
    No, it should not make a diffence.

    You might get some unexpected userform display locations if you open more than one instance of Excel. One might do this if they wanted to work on 2 Excel files with the same name but different locations.

    You can post your xls if you like.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Execute code from auto generated buttons in a userform
    By Tellus in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-27-2008, 09:07 AM
  2. Editing columns through Userform; "Dictionary Editor"
    By wali in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-04-2008, 03:44 PM
  3. Keep Modal UserForm Alive after closing 2nd userform using 2007?
    By ShredDude in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-24-2008, 03:12 PM
  4. Why is my UserForm Pausing Procedure?
    By jasoncw in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-08-2007, 05:20 PM
  5. UserForm Code Question/Help
    By peter.thompson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-14-2006, 02:29 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1