Solved

Excel 2010 VBA form position

Posted on 2012-04-13
1
643 Views
Last Modified: 2012-04-17
Hi Experts

I have an excel spreadsheet with a user form, I cant position the form where I would prefer as I have a dual monitor and the application.left and application.top are positions based upon the 1st monitor posistion.

Ideally I want the form positioned on top of where the spreadhsheet is positioned.

Many thanks
0
Comment
Question by:MrDavidThorn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 16

Accepted Solution

by:
theo kouwenhoven earned 500 total points
ID: 37842166
In the form properties, you can choose:

StartUpPosition = x

Where x can be 0 to 3

0 = Manual (you define where is should start with the Form.top and Form.Left function)
1 = Center owner (Center owner is the middle of your excelsheet)
2 = Center Screen (Center of the screen where the Excel sheet is opened)
3 = Window default (Coordinates 0,0)

If you like to open it relative to the excelsheet, use the following code:

UserForm1.StartUpPosition = 0
UserForm1.Left = Application.Left + 80
UserForm1.Top = Application.Top + 50
UserForm1.Show
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
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 will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

696 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