Form Code Required

  • Thread starter Thread starter John Calder
  • Start date Start date
J

John Calder

Hi

I run Excel 2K

Does anyone have some VB code that forces a form to open to the maximum
screen size available.

Also, where would I put the code if it is available.

Thanks
 
This doesn't force it to open to cover everything on the screen, but does
open it to cover the displayed spreadsheet:

Private Sub UserForm_Initialize()
Me.Width = ActiveWindow.Width
Me.Height = ActiveWindow.Height
End Sub

The code goes into the form's Initialize event process. Here's a page that
shows how to get the current screen resolution, and you could use it in
conjunction with the above code to make the form cover the entire screen.
http://www.bygsoftware.com/Excel/VBA/screen_size.htm
 
Thanks a lots !



JLatham said:
This doesn't force it to open to cover everything on the screen, but does
open it to cover the displayed spreadsheet:

Private Sub UserForm_Initialize()
Me.Width = ActiveWindow.Width
Me.Height = ActiveWindow.Height
End Sub

The code goes into the form's Initialize event process. Here's a page that
shows how to get the current screen resolution, and you could use it in
conjunction with the above code to make the form cover the entire screen.
http://www.bygsoftware.com/Excel/VBA/screen_size.htm
 
You're welcome. I tried mixing the 'get screen size' function in with it to
resize and it actually came out larger than my display, so if you go that
route, it will take some tweaking to get right.
 
Back
Top