ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   open a form maximized (https://www.excelbanter.com/excel-programming/360783-open-form-maximized.html)

eyesonly1965[_4_]

open a form maximized
 

hello i have been searching and searching,
but can't find anything about opening a form maximized.

can anyone tell how to do this?


--
eyesonly1965
------------------------------------------------------------------------
eyesonly1965's Profile: http://www.excelforum.com/member.php...o&userid=34199
View this thread: http://www.excelforum.com/showthread...hreadid=539653


Tom Ogilvy

open a form maximized
 
You can make the userform larger, but it isn't a zoom type operation - the
controls on the form will not resize:

Sub UserForm_Activate()
With Application
'maximize Excel
.WindowState = xlMaximized
Me.Top = .Top
Me.Left = .Left
Me.Height = .Height
Me.Wdith = .Width
End With
End Sub


Sub FormFit()
UserForm1.Show
End Sub


The above assumes excel is maximized. (I added code to maximize it)


The activate event is in the Userform code module.

--
Regards,
Tom Ogilvy



"eyesonly1965" wrote:


hello i have been searching and searching,
but can't find anything about opening a form maximized.

can anyone tell how to do this?


--
eyesonly1965
------------------------------------------------------------------------
eyesonly1965's Profile: http://www.excelforum.com/member.php...o&userid=34199
View this thread: http://www.excelforum.com/showthread...hreadid=539653



Tom Ogilvy

open a form maximized
 
Here is one from Chip Pearson:

With Application
UserForm1.Move .Left, .Top, .Width, .Height
End With
UserForm1.Show

Note that both of the suggestions size the useform - they don't make it a
maximized window which would need to be done using the windows API.
However, they may be sufficient for what you need.

--
Regards,
Tom Ogilvy







"Tom Ogilvy" wrote:

You can make the userform larger, but it isn't a zoom type operation - the
controls on the form will not resize:

Sub UserForm_Activate()
With Application
'maximize Excel
.WindowState = xlMaximized
Me.Top = .Top
Me.Left = .Left
Me.Height = .Height
Me.Wdith = .Width
End With
End Sub


Sub FormFit()
UserForm1.Show
End Sub


The above assumes excel is maximized. (I added code to maximize it)


The activate event is in the Userform code module.

--
Regards,
Tom Ogilvy



"eyesonly1965" wrote:


hello i have been searching and searching,
but can't find anything about opening a form maximized.

can anyone tell how to do this?


--
eyesonly1965
------------------------------------------------------------------------
eyesonly1965's Profile: http://www.excelforum.com/member.php...o&userid=34199
View this thread: http://www.excelforum.com/showthread...hreadid=539653



eyesonly1965[_5_]

open a form maximized
 

thanx this is excactly what i was looking for.
it works just fine now

--
eyesonly196
-----------------------------------------------------------------------
eyesonly1965's Profile: http://www.excelforum.com/member.php...fo&userid=3419
View this thread: http://www.excelforum.com/showthread.php?threadid=53965



All times are GMT +1. The time now is 02:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com