Solved

Excel 2010 VBA form position

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
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…

770 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