Open a Usefrom w/MultiPage to a specified tab

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,340
Office Version
  1. 365
Platform
  1. Windows
Can you open a Usefrom that has a MultiPage and go to a specified tab using a Macro/Code?

Thanks
Greg
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I must be doing something wrong. The UserForm that the multipage is on is UserFrom1 I want to go to Tab 7 "Page7".

I want the user to be able to goto the userform and tab from a button on an excel sheet.

Private Sub CommandButton5_Click()
Sheets("FY SPREAD").Range("A1").Value = Sheets("FY SPREAD").Range("A3").Value
Unload Me
UserForm1.Show
Me.MultiPage1.Value = 3
End Sub
 
Upvote 0
Greg

You appear to be doing a number of things wrong I think.

One that code looks like it's for a command button on a worksheet or another userfomr.

Second I'm not sure of your use of Me, see above.

Also you mention tab 7 but the code has tab 3 (4 really).:eek:
 
Upvote 0
Norie

xld's reply used 3. Not sure what or how the suggested code works.

Yes, I have a userform that has a command button (5). I am trying to close that userform (Unload Me) then open another UserForm (UserForm1) and then go to a specific tab on a Multipage which is on the UserForm1. The tab I am trying to go to is Page7.

Suggestions?

Thanks for the assistance.
 
Upvote 0
Greg

If you want to goto page 7 on the multipage in the newly opened userform put the code to do so in it's Initialize event.
Code:
Private Sub UserForm_Initialize()
      Me.MultiPage1.Value = 6
End Sub
 
Upvote 0
Thanks, but if I am correct, that means that every time UserForm1 is intialized, it goes to tab7 (page7). That doesnt get me to where I want to be. I am trying to control which page it goes to depending on user choices. Sometimes they need to go to Page7 Sometimes it will be Page5. Is there another way?
 
Upvote 0
Greg

Yup, you are right that will always go to page 7.

But then again you never actually seemed to mention anything about user choices.:eek:

Without further information it's kind of hard to help.:)

eg where is this user choice made, what is the basis for which page to select?
 
Upvote 0
Thanks

I have a userform with several command buttons on it. Each button will open UserForm1 but then I would like to be able to go to a specific tab on the Multipage which is on Userform1. The Multipage has 5 tabs. Command button1 should open UserForm1 and then go to tab1. Command Button2 should open UserForm1 and then go to tab2 (page2) on the multipage... and so on

Hope that makes it a little clearer.

Thanks again for the help
 
Upvote 0
Greg

It makes sense but it doesn't sound to me like a good approach.

Why not have a combobox (or listbox) and 1 command button?
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

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