Autosize a userform in excel

  • Thread starter Thread starter Rhema
  • Start date Start date
R

Rhema

I have a userform in excel. When I display it in 1024X768 it display
correctly(fullscreen). When it is displayed in 800X640 the form i
oversize. How do i make it autosize no matter what the scree
resolution it is displayed on.

Thanks in advanc
 
This will get the window size. Perhaps you can zoom accordingly.

' ----------------------------------------------
Private Declare Function GetSystemMetrics _
Lib "user32" (ByVal nIndex As Long) As Long
Private Const SM_CXSCREEN = 0
Private Const SM_CYSCREEN = 1
'------------------------------------------------
Sub GET_WINDOW_SIZE()
x = GetSystemMetrics(SM_CXSCREEN)
y = GetSystemMetrics(SM_CYSCREEN)
MsgBox ("Window size is " & x & " x " & y)
End Sub
'----------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top