Solved

User  Form Initialize behaviour

Posted on 2012-03-16
2
190 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Compile Error 7 40
Easy Excel formula needed 4 23
SUMIFS with a criteria that could be in multiple rows 21 33
Applying Background Image to All Sheets in Excel 1 13
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

919 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now