Solved

User  Form Initialize behaviour

Posted on 2012-03-16
2
188 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
Comment Utility
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
Comment Utility
Thanks Shanan!

Seamus
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

763 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

5 Experts available now in Live!

Get 1:1 Help Now