title: Selecting Specific Pages in a Userform when MultiPages are Nested
body: <p>I have a single userform with 3 &quot;top-level&quot; pages (using the multipage functionality) and then four nested pages each within two of the top-level pages.</p>
  <h3>Screenshot of Nested Multipage Userform</h3>
  <p><img src="https://i.stack.imgur.com/B95uA.png" alt="Screenshot of Nested Multipage Userform" /></p>
  <p>In this example, the page captions and names are the same. Therefore, the page with the caption of Page4 is also named Page4. I found code online that is supposed to return the page index when the page name is passed to it:</p>
  <pre><code>Function fMpIndex(ByVal PageName As String)
  
      Dim PageCounter As Long
  
      With MultiPage1
  
          For PageCounter = 0 To .Pages.Count - 1
  
              If .Pages(PageCounter).Name = PageName Then fMpIndex = PageCounter: Exit Function
          Next PageCounter
      End With
      fMpIndex = -1
  
  End Function
  </code></pre>
  <p>This works for the top-level pages, however, when I try something like:</p>
  <pre><code>MsgBox (&quot;This page's index is &quot; &amp; fMpIndex(&quot;Page5&quot;))
  </code></pre>
  <p>for any of the nested pages (in this example, both pages 4 &amp; 5), then this method returns a value of -1, indicating that the page does not exist. Is this a scope issue? Does the code above only search for the top-level pages and not the nested pages?</p>
  <p>What is the safest, most reliable way to programmatically reference a specific page by either name or caption or both? I assume it would be something like:</p>
  <pre><code>which userform.which page strip.which page.name(&quot;Page5&quot;)
  </code></pre>
  <p>In this example, I only have one userform, but what if I had two userforms? Also, in the above example, I am assuming that one must specify which of the two page strips are being referenced.</p>
  <p>Ideally, I want a way to use an absolute reference to each page in the userform regardless of whether it is a top-level page or a nested page.</p>