Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
'---------------------------------
Public Function GetSR() As Variant
GetSR = Array(GetSystemMetrics(0), GetSystemMetrics(1))
End Function
'-----------------
Sub ResizeForm_R1()
' Adjusts userform size to compensate for screen resolution changes.
'Call function to get actual screen resolution
varSize = GetSR
resX = varSize(0)
resY = varSize(1)
'Determine ratio of actual screen resolution to
'the original or base resolution.
RatioX = resX / UserForm1.Width
RatioY = resY / UserForm1.Height
RY = 3.5
RX = 1.66
Fact = 1 ' 1 = full screen , 2 for half
'Adjust userform magnification and size.
UserForm1.Zoom = 100 * RatioX / 1.66 / Fact
UserForm1.Width = UserForm1.Width * RatioX / RX / Fact
UserForm1.Height = UserForm1.Height * RatioY / RY / Fact
UserForm1.Show
End Sub