Form Code Required

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
 
J

JLatham

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
 
J

John Calder

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
 
J

JLatham

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top