Help so MultiPage in UserForm points to the last number of a named worksheet

Phixtit

Active Member
Joined
Oct 23, 2008
Messages
346
I'm using MultiPage in a UserForm
I have multiple worksheets that can range from: HOLE 1 and go up to HOLE 30
I have other multiple worksheets that can range from: SAFETY 1 and go up to SAFETY 30
When I use the Code below it always goes to the 1st worksheet named either HOLE 1 or SAFETY 1
How can I have it so that when I click on the MultiPage Tab that it goes to the last sheet on the right for each?
Example: If I'm on SAFETY 5 it would go to that sheet, and not SAFETY 1 like it does now.

Here is my code:
Code:
Private Sub MultiPage1_Change()
    Select Case MultiPage1.Value
    Case 0 'page 1
        Workbooks("Workbook.xls").Sheets _
        ("HOLE 1").Activate
    Case 1 'page 2
        Workbooks("Workbook.xls").Sheets _
        ("SAFETY 1").Activate
End Sub
 
Solved! :)

Problem Solved!
I tried out both codes & they worked, But I am using yours as it looks better.

Thanks Again Bill! :)
 
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

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