Excel : VBA : Userform in full screen mode

RAKESH230583

New Member
Joined
Jan 10, 2011
Messages
46
Dear All,

I have created one userform which has the width of 1022.25 additionally in order to run it in full screen mode. I had used the below quoted VBA CODE.


Quote

Private Sub UserForm_Activate()
'****************************************************************
'Opening userform in full screen
'****************************************************************

Application.WindowState = xlMaximized
Me.Height = Application.Height - 10
Me.Width = Application.Width - 10

End Sub
Unquote

Additionally, I had used the below quoted VBA Code to minimize and maximize the userform with the help of ToogleButton1.

Quote

Private Sub ToggleButton1_Click()
'****************************************************************
'Minimize the Userform
'****************************************************************

If Me.ToggleButton1.Value = True Then

Me.ToggleButton1.Caption = "Maximize Form"

Me.Height = 60
Me.Width = 200
Me.Top = 450
Me.Left = 10

Me.ToggleButton1.Left = 777.6
Me.ToggleButton1.Top = 10
Me.Width = Application.Width - 10
Me.ToggleButton1.BackColor = &H8000000F
Me.ToggleButton1.BackStyle = fmBackStyleOpaque
Me.ToggleButton1.ForeColor = &H80000012

Me.Save_Details.Top = 10
Me.Email.Top = 10
Me.Discard.Top = 10
Me.Label_16.Visible = False

Else

Me.ToggleButton1.Caption = "Minimize Form"

Me.Height = Application.Height - 10
Me.Width = Application.Width - 10
Me.Top = 0
Me.Left = 0

Me.ToggleButton1.Left = 777.6
Me.ToggleButton1.Top = 486
Me.Width = Application.Width - 10
Me.Label_16.Visible = True
Me.Save_Details.Top = 486
Me.Email.Top = 486
Me.Discard.Top = 486

End If
End Sub
Unquote.

Now, Thing is that – When I am using the excel file is working fine for me– But if someone else from my team uses the same excel in their Workstation – Some parts (from right side) of userform gets cropped and users are not able to view it. I believe that this is because screen size of all users workstation vary from each other.

I Don't want to restructure my current userform – as spent lot of time in it – But is there any way out where everyone (with different screen size) able to view the complete userform with in full screen mode.

Please feel free to ask in case any additional information is required.

Thanks in advance for your support.
 
Last edited:

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
This is not really a answer to your question. But I'm wondering why you would need a UserForm so big.

Have you ever tried using MultiPages on your UserForm?

Using Multipages can be like having 5 10 or more UserForms all on the same Userform.

Each Multipage can be dedicated to just certain categories of your data.
 
Last edited:
Upvote 0
Hi - I Thought to capture all in single view - but now its already done and as mentioned that I don't have that much of time to restructure all from scrap.

If I can get the correct VBA Code then I belive that my problem will be solved without changing anything.
 
Upvote 0
I've borrowed this code from elsewhere in the forums

Use "Zoom to Selection"

Enter this as the last element before each of the minimise/maximise code finishes

Dim zArea As String
zArea = "A1:(ENTER YOUR FAR RIGHT HAND CELL REFERENCE)"
Range(zArea).Select
ActiveWindow.Zoom = True
 
Upvote 0
Do we have any Code to assist on above - Or is there any code which can zoom the userform for autofit to screen window.
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,942
Members
449,094
Latest member
teemeren

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