ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open userform at top of form (https://www.excelbanter.com/excel-programming/432130-open-userform-top-form.html)

[email protected]

Open userform at top of form
 
I have a long userform with scroll bar. When I open the form, it
opens in the middle of the form. I would like for the form to open at
the top of the form. I am sure there must be an easy way to do this
in the initialize sub, but I do not know how to do it. Could someone
help me with the code to open the form at the top of the form? I
appreciate it.

Thanks.

OssieMac

Open userform at top of form
 
The code goes in the Userform Initialize sub. However, the position appears
to be screen based and not related to Excel worksheets.

Left = 0 and top = 0 for top left of screen.

Private Sub UserForm_Initialize()
UserForm1.Left = 200
UserForm1.Top = 350
End Sub


--
Regards,

OssieMac


" wrote:

I have a long userform with scroll bar. When I open the form, it
opens in the middle of the form. I would like for the form to open at
the top of the form. I am sure there must be an easy way to do this
in the initialize sub, but I do not know how to do it. Could someone
help me with the code to open the form at the top of the form? I
appreciate it.

Thanks.


OssieMac

Open userform at top of form
 
Forgot to say Set the forms StartUpPosition property to Manual.

--
Regards,

OssieMac


RJQMAN[_2_]

Open userform at top of form
 
On Aug 7, 12:37*am, OssieMac
wrote:
Forgot to say Set the forms StartUpPosition property to Manual.

--
Regards,

OssieMac


Thanks. Yes, it does position the userform on the screen as you say,
and for reasons I do not understand, the form now opens at the top. I
had to make a minor adjustment, as the form is wide and long, and I
minimize the worksheet page behind it when I display the form so that
the background is not as cluttered and distracting, so I made smaller
parameters (75 and 80 instead of 200 and 350), but you are correct,
the form now opens at the top of the form instead of in the middle.
Ahhh, the mysteries of life.

Thanks for your help.


All times are GMT +1. The time now is 07:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com