Hi All,
I have a workbook with a user form that opens full screen when run. My problem is the user form is designed for 1024x768 and as the workbook is now being used on machines with 800x600 res the user form looks, well, wappy!!
I've managed to write some code that checks the current screen res (see below), however I can't for the life of me work out how to tie this in to resizing the user form depending on the res it's being used at.
Any ideas folks??
Option Explicit
Private Const SM_CXSCREEN = 0
Private Const SM_CYSCREEN = 1
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
Private Sub UserForm_Activate()
Dim width As Long, height As Long
width = GetSystemMetrics(SM_CXSCREEN)
height = GetSystemMetrics(SM_CYSCREEN)
MsgBox "Screen Width = " & width & Chr(10) & "Screen Height = " & height
End Sub