Form resize based on screen resolution.
Using Tom's routine you may then be able to zoom the userform to an
appropriate size. To play with the UF Zoom property
create a UF with two buttons and copy this code in.
Private Sub CommandButton1_Click()
Me.Zoom = Me.Zoom * 1.1
Me.Height = Me.Height * 1.1
Me.Width = Me.Width * 1.1
End Sub
Private Sub CommandButton2_Click()
Me.Zoom = Me.Zoom / 1.1
Me.Height = Me.Height / 1.1
Me.Width = Me.Width / 1.1
End Sub
--
Jim Rech
Excel MVP
"Eric" wrote in message
...
| Does anyone know if it is possible to have VBA code check the current
setting for screen resolution and adjust the form size based on the screen
resolution? For example, I have a application I have written in Excel that
has user forms, if the screen resolution is set to 1024 x 768 the forms show
correctly, however if the screen resolution is set to 800 x 600 the form is
larger than the screen. Can this be adjusted in code?
|