Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello, All
Is anyone knows how to control the UserForm's position? It seems that i couldn't to find the Screen.Width or Screen.Height property in VBA. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this
http://www.cpearson.com/excel/FormPosition.htm -- HTH Bob Phillips "OKLover" wrote in message ... Hello, All Is anyone knows how to control the UserForm's position? It seems that i couldn't to find the Screen.Width or Screen.Height property in VBA. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There is no Screen object like in VB, and Excel's metrics is not pixels
either -at least not all over. But this places the userform down right on my screen, no matter what and where the Excel window is: Declare Function GetSystemMetrics32 Lib "user32" _ Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long Public Const SM_CXSCREEN = 0 Public Const SM_CYSCREEN = 1 Sub test() Dim X As Long, Y As Long X = GetSystemMetrics32(SM_CXSCREEN) Y = GetSystemMetrics32(SM_CYSCREEN) With UserForm1 ..StartUpPosition = 0 ..Top = (Y - .Height - 50) * 0.71 ..Left = (X - .Width - 50) * 0.71 ..Show End With End Sub Code modified from http://www.j-walk.com/ss/excel/tips/tip06.htm HTH. Best wishes Harald "OKLover" skrev i melding ... Hello, All Is anyone knows how to control the UserForm's position? It seems that i couldn't to find the Screen.Width or Screen.Height property in VBA. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks to Bob and Harald, i will try it. :D
"OKLover" l... Hello, All Is anyone knows how to control the UserForm's position? It seems that i couldn't to find the Screen.Width or Screen.Height property in VBA. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
2007 Form Control/ActiveX Control font difference | Excel Discussion (Misc queries) | |||
How to find UserForm's caller? | Excel Discussion (Misc queries) | |||
RunTime Error 424 in a USERFORM's code | Excel Programming | |||
control scroll position | Excel Programming |