View Single Post
  #15   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default How do you resize a Multi Page User Form?

Hi Brian,

Public declarations must be at the TOP of a STANDARD module and you cannot
change the Public declarations to Private. Therefore the code below goes at
the top of a standard module and do not change anything in the declarations.
(I have now included STANDARD module in the comment.)

I would not place the remainder of the code in a Worksheet_SelectionChange
event because if you do that it will run as soon as you click a cell on the
worksheet. (or perhaps that is what you want it to do). I think it would be
preferrable to place a command button on the worksheet and attach the code to
the button. Basically it is the Userform Show code and Userform1.Show must be
the last command in the Sub. (In my code it is incorporated in a With / End
With but it is still the last executable line of code.)

Option Explicit

'API declaration (At top of STANDARD module)
Declare Function GetSystemMetrics32 _
Lib "user32" _
Alias "GetSystemMetrics" _
(ByVal nIndex As Long) As Long

Public Const SM_CXSCREEN = 0
Public Const SM_CYSCREEN = 1

--
Regards,

OssieMac