Change Start Page Of Multi Page UserForm

  • Hi ,all.
    Is it possible to Change Start Page Of Multi Page UserForm Based on 8 CommandButtons
    on a WorkSheet, for example.

    Code
    1. CommandButton1
    2. UserForm1.MultiPage1.Value = 0
    3. CommandButton2
    4. UserForm1.MultiPage1.Value = 1
    5. CommandButton3
    6. UserForm1.MultiPage1.Value = 2
    7. CommandButton4
    8. UserForm1.MultiPage1.Value = 3


    Could I use 1 multipage UserForm Instead of 8 UserFoms
    Is it better to use 1 multipage UserForm with 8 pages or 8 UserForms
    I dont know if this make sense or not?
    I really hope someone will be able to guide me!!
    Thanks

  • Re: Change Start Page Of Multi Page UserForm


    I generally use MultiPage for related tasks in UserForms


    You can use this code in the buttons, p will be the Multipage page so change it to whichever page you want to open with. Remember the pages are numbered starting fro 0


    Code
    1. Option Explicit
    2. Private Sub CommandButton1_Click()
    3. Dim p As Integer
    4. p = 1
    5. UserForm1.MultiPage1.Value = 1
    6. UserForm1.Show
    7. End Sub


    Then in the UserForm add this code

    Code
    1. Option Explicit
    2. Private Sub UserForm_Click()
    3. Me.MultiPage1.Value = p
    4. End Sub
  • Re: Change Start Page Of Multi Page UserForm



    Thanks Roy for gettimg back so quickly!!!!