Solved

User  Form Initialize behaviour

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

813 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

12 Experts available now in Live!

Get 1:1 Help Now