Solved

Excel 2010 VBA form position

Posted on 2012-04-13
1
635 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
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

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

830 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