Results 1 to 6 of 6

Thread: How to select dynamic multipage tab please?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,411
    Location
    Well obviously you can't set the focus on a control positioned on a hidden page tab.

    Private Sub UserForm_Initialize()
    Dim lngIndex As Long
      With MultiPage1
        .Value = 0
        .Pages(5).Visible = False
        .Pages(6).Visible = False
        .Pages(7).Visible = False
    On Error GoTo Err_Enabler
        For lngIndex = 0 To MultiPage1.Pages.Count
           If TextBox1 = vbNullString Then
             TextBox1.SetFocus
             Exit For
           End If
        Next
      End With
    lbl_Exit:
      Exit Sub
    Err_Enabler:
      lngIndex = lngIndex + 1
      MultiPage1.Value = lngIndex
      Resume
    End Sub
    Last edited by gmaxey; 07-25-2017 at 05:34 AM.
    Greg

    Visit my website: http://gregmaxey.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •