nested multi page userform

charly1

Board Regular
Joined
Jul 18, 2023
Messages
87
Office Version
  1. 365
Platform
  1. Windows
Hi all
I'd appreciate if anyone would be able to help me.

I have a user form with a multipage control [6 pages]. Page 4 contains a nested multipage consisting of two additional pages.
I have already created command buttons on the first 2 pages of the user form to jump to the next page using the code below:


VBA Code:
Dim NextPage1 As Long
    NextPage1 = UserForm1.MultiPage1.SelectedItem.Index + 1
    UserForm1.MultiPage1.Value = NextPage1

My problem is that on page 3 my command button needs to be able to jump next page - in this case being page 1 or 2 [using if function] of the nested multipage2.

I have tried to work this out myself but I cannot seem to manage?
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Anyway I've been banging my head on the wall and i cant work it out. I've tried another way of getting the same result and again it is just not working.
I have rearranged my user form to contain only a single multi page. Depending on text entered into textbox i need the command button to either jump to the next page in the multipage or the page after that. I have posted my code below, all i get is error. Please if anyone can help me out I would appreciate it immensely.

VBA Code:
Private Sub ButtonNewSeferNextPlace_Click()
    Dim NextPage As Long
    NextPage = UserFormNewSefer.MultiPage1.SelectedItem.Index + 1
    If UserFormNewSefer.TextBoxNewSeferVolume.Value = 0 Then
        UserFormNewSefer.MultiPage1.Value = NextPage
    Else
    UserFormNewSefer.MultiPage1.Value = NextPage + 1
    End If
End Sub
 
Upvote 0
Hi All
Spent the morning on it. Seems there was nothing wrong with the code. I had this addin called CodeVBA installed on my pc. I removed it and reran the code, it worked like a charm. Goes to show what you get for paying through the roof for vba add ins
Thanks
 
Upvote 0
Solution

Forum statistics

Threads
1,223,887
Messages
6,175,199
Members
452,617
Latest member
Narendra Babu D

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