This is how to make your userfrom fullscreen

michaeldh

Board Regular
Joined
Jun 11, 2002
Messages
201
Hi Guy's,

This is how to make a userform go full screen...hope this helps.

With Application
.WindowState = xlMaximized
Zoom = Int(.Width / Me.Width * 100)
Width = .Width
Height = .Height
End With

Michael.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
On 2003-01-02 05:42, michaeldh wrote:
Hi Guy's,

This is how to make a userform go full screen...hope this helps.

With Application
.WindowState = xlMaximized
Zoom = Int(.Width / Me.Width * 100)
Width = .Width
Height = .Height
End With

Michael.

Hi Michael
Shouldn't that be

<pre/>
Private Sub UserForm_Initialize()

With Application
.WindowState = xlMaximized
Zoom = Int(.Width / Me.Width * 100)
Me.Width = .Width
Me.Height = .Height
End With

End Sub
</pre>

Me Key word missing :smile:
 
Upvote 0
Hi,

Supprisingly enough the code works without the .Me

A couple of other people have suggested different ways of doing it.

Thanks for your help.

Michael.
 
Upvote 0
On 2003-01-02 05:58, michaeldh wrote:
Hi,

Supprisingly enough the code works without the .Me

A couple of other people have suggested different ways of doing it.

Thanks for your help.

Michael.

Hi Micheal, where have you got this code and
what version of Excel ?

Thanks
 
Upvote 0
Hi Ivan,

Someone helped me out on Mr Excel a few mths ago...I am using Office XP Pro.

I was writing this wiz bang tax program for a car dealership and needed to get a userform to maximise.

Seems to be lots of different ways of doing things in VBA...much with everything in Excel.

How's the whether over there where you are...its about 38 degrees over here...very hot.

Mike.
 
Upvote 0
Hi Ivan,

Inside a class module, which is what the userform code module is, the Me. is redundant. I guess the designers of VB(A) figured on saving a few keystrokes. Using Me still is very good programming practice. Personally, I wish it were enforceable.

On 2003-01-02 05:49, Ivan F Moala wrote:
On 2003-01-02 05:42, michaeldh wrote:
Hi Guy's,

This is how to make a userform go full screen...hope this helps.

With Application
.WindowState = xlMaximized
Zoom = Int(.Width / Me.Width * 100)
Width = .Width
Height = .Height
End With

Michael.

Hi Michael
Shouldn't that be

<pre/>
Private Sub UserForm_Initialize()

With Application
.WindowState = xlMaximized
Zoom = Int(.Width / Me.Width * 100)
Me.Width = .Width
Me.Height = .Height
End With

End Sub
</pre>

Me Key word missing :smile:
 
Upvote 0
On 2003-01-02 10:23, tusharm wrote:
Hi Ivan,

Inside a class module, which is what the userform code module is, the Me. is redundant. I guess the designers of VB(A) figured on saving a few keystrokes. Using Me still is very good programming practice. Personally, I wish it were enforceable.

Hi Tusharm
Ah, yes you are correct, I never tested it
and thought it wouldn't work. Yes the form is a Class and while that makes sence (ie. Class Modules / properties of the Class etc) I agree with you, it should remain explicit...I will still use it!! just good practice.

Cheers
 
Upvote 0

Forum statistics

Threads
1,226,230
Messages
6,189,770
Members
453,568
Latest member
LaTwiglet85

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top