Userform: Show last viewed multipage on open

Joined
Mar 22, 2022
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hello-

First time poster here.

I have a userform with 10 tabs currently and would like to know how to set it so that if I'm working on Tab1, close the Userform, re-initialize the Userform, it will open on Tab1 or whichever tab the user was last working on.

Currently hardcoding it as MultiPage1.value = 0 in the UserForm_initialize sub.

Or should I be adding the code in the Private Sub MultiPage1_Change() sub?

Thank you!
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi & welcome to MrExcel!

This can be done in two ways:
- store the number of the relevant page in a public variable in a module other than that of the userform before closing the userform, and use that variable for setting focus on the required page;
- leave the userform alive on closing and thus only Hide it, so that the userform is displayed in the state it was in when it was closed on a subsequent Show.
 
Upvote 0
Hi & welcome to MrExcel!

This can be done in two ways:
- store the number of the relevant page in a public variable in a module other than that of the userform before closing the userform, and use that variable for setting focus on the required page;
- leave the userform alive on closing and thus only Hide it, so that the userform is displayed in the state it was in when it was closed on a subsequent Show.
Awesome to be here, finally signed up and will definitely be active trying to learn more about VBA.

I managed to store the number on a different sheet upon userform termination, then called it back when it initialized.

Thank you @GWteB
 
Upvote 0

Forum statistics

Threads
1,215,067
Messages
6,122,949
Members
449,095
Latest member
nmaske

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