ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Setting the page index in a mulipage user form (https://www.excelbanter.com/excel-programming/359023-setting-page-index-mulipage-user-form.html)

Trefor

Setting the page index in a mulipage user form
 
I got some help ealry on when I first started using userforms and I wanted
the page to also be the default page so I added MultiPage1.Value = 0 to the
UserForm_Initialize() sub. Now I want to be able to preselt which page is the
"active" page, how can I do this?

Sub UserForm_Initialize()
Me.Height = Application.Height
Me.Width = Application.Width
MultiPage1.Value = 0
End Sub

--
Trefor

Tom Ogilvy

Setting the page index in a mulipage user form
 
zero is the first page. If you wanted the third page to be the topmost page
you would do

Sub UserForm_Initialize()
Me.Height = Application.Height
Me.Width = Application.Width
MultiPage1.Value = 2
End Sub

--
Regards,
Tom Ogilvy


"Trefor" wrote:

I got some help ealry on when I first started using userforms and I wanted
the page to also be the default page so I added MultiPage1.Value = 0 to the
UserForm_Initialize() sub. Now I want to be able to preselt which page is the
"active" page, how can I do this?

Sub UserForm_Initialize()
Me.Height = Application.Height
Me.Width = Application.Width
MultiPage1.Value = 0
End Sub

--
Trefor


Trefor

Setting the page index in a mulipage user form
 
Tom,

Thanks, but what I needed to do was be able to pick and change which is the
default page and I was not sure how. I simply replaced the 2 in your example
with a variable before the userform.show and this seems to have done the
trick. Many thanks.

--
Trefor


"Tom Ogilvy" wrote:

zero is the first page. If you wanted the third page to be the topmost page
you would do

Sub UserForm_Initialize()
Me.Height = Application.Height
Me.Width = Application.Width
MultiPage1.Value = 2
End Sub

--
Regards,
Tom Ogilvy


"Trefor" wrote:

I got some help ealry on when I first started using userforms and I wanted
the page to also be the default page so I added MultiPage1.Value = 0 to the
UserForm_Initialize() sub. Now I want to be able to preselt which page is the
"active" page, how can I do this?

Sub UserForm_Initialize()
Me.Height = Application.Height
Me.Width = Application.Width
MultiPage1.Value = 0
End Sub

--
Trefor



All times are GMT +1. The time now is 07:22 PM.

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