ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Determining Which Page of MultiPage Initially Shows (https://www.excelbanter.com/excel-programming/332448-determining-page-multipage-initially-shows.html)

Michael Malinsky[_2_]

Determining Which Page of MultiPage Initially Shows
 
I have UserForm1 with MultiPage1. Page0 has three option buttons, One,
Two, and Three. If One is selected, the next page shown is Page1 and
so on. Once the process is complete, the code dumps various
information into a worksheet (including the value of the option button
selected).

If the user runs the code again, instead of initially showing Page0,
I'd like to initially show the page corresponding to the option button
selected the first time around. Since I have the selection already in
the worksheet, I figure I can use that to run a Select...Case, but I
cannot seem to get the proper page of MultiPage1 to display as desired.
Page0 always seems to pop up. I'm assuming that I would put this in a
UserForm_Initialize procedure.

Thanks,
Mike.


Jim Rech

Determining Which Page of MultiPage Initially Shows
 
The easiest way to have a userform reappear in the same state as it was in
when last dismissed (in the same Excel session) is just to use Me.Hide
instead of Unload with your OK button.

--
Jim
"Michael Malinsky" wrote in message
oups.com...
|I have UserForm1 with MultiPage1. Page0 has three option buttons, One,
| Two, and Three. If One is selected, the next page shown is Page1 and
| so on. Once the process is complete, the code dumps various
| information into a worksheet (including the value of the option button
| selected).
|
| If the user runs the code again, instead of initially showing Page0,
| I'd like to initially show the page corresponding to the option button
| selected the first time around. Since I have the selection already in
| the worksheet, I figure I can use that to run a Select...Case, but I
| cannot seem to get the proper page of MultiPage1 to display as desired.
| Page0 always seems to pop up. I'm assuming that I would put this in a
| UserForm_Initialize procedure.
|
| Thanks,
| Mike.
|



Michael Malinsky[_2_]

Determining Which Page of MultiPage Initially Shows
 
But theoretically someone could save, close and reopen the file so that
won't work, will it?

Also, just to muddy the waters (and I should have put this in my first
post)...

Page0 - select option 1, 2, or 3 (selected option will next show Page1,
Page2, or Page3)
Page1 - do stuff then show Page4
Page2 - do stuff then show Page4
Page3 - do stuff then show Page4
Page4 - do stuff then Finish

So the first time the code is run, it will start on Page0 and end on
Page4 with Page1, Page2, or Page3 in the middle depending on the option
button selected in Page0. So hiding the UserForm still won't provide
the desired result. So if I choose option 2 the first time the code is
run, I want to start with Page2 if the code is run again.

Is that clearer?

Thanks,
Mike.


Tom Ogilvy

Determining Which Page of MultiPage Initially Shows
 
Assuming worksheet Results in cell A1 holds a value 1, 2, or 3 reflecting
the option button selected then possibly

Private Sub Userform_Activate()
Multipage1.Value = Worksheets("Results").Range("A1").Value
End Sub

--
Regards,
Tom Ogilvy


"Michael Malinsky" wrote in message
oups.com...
But theoretically someone could save, close and reopen the file so that
won't work, will it?

Also, just to muddy the waters (and I should have put this in my first
post)...

Page0 - select option 1, 2, or 3 (selected option will next show Page1,
Page2, or Page3)
Page1 - do stuff then show Page4
Page2 - do stuff then show Page4
Page3 - do stuff then show Page4
Page4 - do stuff then Finish

So the first time the code is run, it will start on Page0 and end on
Page4 with Page1, Page2, or Page3 in the middle depending on the option
button selected in Page0. So hiding the UserForm still won't provide
the desired result. So if I choose option 2 the first time the code is
run, I want to start with Page2 if the code is run again.

Is that clearer?

Thanks,
Mike.





All times are GMT +1. The time now is 11:14 AM.

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