newbie23
newbie23

Reputation: 49

changing sizes of individual userform pages

I have an excel multipage userform, and I would like the pages to be different sizes/height. I have tried the following code:

sub multipage1_change()
select case me.multipage1.value
case 0
Me.multipage1.height=500
case 1
Me.multipage1.height=600
case 2 
Me.multipage1.height=800
end sub

Unfortunately all that happens is the largest userform size is always visible and the smaller userform pages are simply overlaid onto it. Surely it is possible to have the different pages be different heights?

Upvotes: 0

Views: 963

Answers (2)

Error 1004
Error 1004

Reputation: 8230

Double click on the MultiPage and import the below code. Make sure that you import the code on "Private Sub MultiPage1_Change" see below:

enter image description here

Try:

Private Sub MultiPage1_Change()

Select Case MultiPage1.SelectedItem.Name
    Case "Page1": MultiPage1.Height = 500
    Case "Page2": MultiPage1.Height = 600
    Case "Page3": MultiPage1.Height = 800
End Select

End Sub

Upvotes: 1

Irregular Expression
Irregular Expression

Reputation: 101

Try MultiPage1.SelectedItem.Index instead of MultiPage1.Value or TabFixedHeight instead of height.

Upvotes: 0

Related Questions