Question

I have a UserForm in Excel with MultiPage object. I need to add more tab pages into the MultiPage object dynamically, by copying and pasting one of the existing tab pages. Any help would be appreciated.

Thank you

Was it helpful?

Solution

You can do this by using this piece of code

Option Explicit

Private Sub CommandButton1_Click()

    '~~> Change 1 to the respective page index which you want to replicate
    MultiPage1.Pages(1).Controls.Copy

    '~~> Add a New page
    MultiPage1.Pages.Add

    '~~> Paste the copied controls
    MultiPage1.Pages(MultiPage1.Pages.Count - 1).Paste

End Sub

SNAPSHOT

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top