Identifying which tab of a UserForm MultiPage is selected

MattOCUSA

Board Regular
Joined
Jan 12, 2007
Messages
231
I have 2 tabs on a UserForm. I am referring to the "MultiPage" object of my user form, not the "TabStrip."

I set up my user form with 2 Tabs on the top of it. Once either tab is completed by the user, they can click a Go button which is below the bottom of the MultiPage tab layout of the UserForm. So, to clarify, whether the user is inputting info on Tab1 or Tab2, they always see the SAME Go button below the MultiPage tab's on my user form. My problem now is I need to know if the user completed Tab1 or Tab2? I'd rather not test if a box is blank on either form or not, I'm hoping I can test for which tab is currently shown/selected by the user when they press go?

Thank You,
Matt
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
This will test which Page is Active when the Command Button is pressed:


Private Sub CommandButton1_Click()
'UserForm code module code only!
Dim lngTabIndx&

lngTabIndx = MultiPage1.Value

If lngTabIndx = 0 Then
MsgBox "Page1"

ElseIf lngTabIndx = 1 Then
MsgBox "Page2"
End If

MsgBox lngTabIndx
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,728
Members
448,987
Latest member
marion_davis

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