Solved

User  Form Initialize behaviour

Posted on 2012-03-16
2
192 Views
Last Modified: 2012-08-13
Hi,

I work of two screens.

if excel is open on one screen adn i open a particular WB with a userform, the userform pops up on the other screen. How can i change the properties/behaviour so that it opens where the WB is and in the centre ofthe screen

Thanks
Seamus
0
Comment
Question by:Seamus2626
2 Comments
 
LVL 13

Accepted Solution

by:
Shanan212 earned 500 total points
ID: 37729236
Sub UserformOpen

    Application.DisplayAlerts = False
    Application.ScreenUpdating = False

    With UserFormName
        .StartUpPosition = 0
        .Left = Application.Left + (0.5 * Application.Width) - (0.5 * .Width)
        .Top = Application.Top + (0.5 * Application.Height) - (0.5 * .Height)
    End With

    UserFormName.Show
    
    Application.DisplayAlerts = True
    Application.ScreenUpdating = True
    
End Sub

Open in new window


Replace UserFormName with your user form's name

This centers the userform as you required
0
 

Author Closing Comment

by:Seamus2626
ID: 37729396
Thanks Shanan!

Seamus
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question