Reputation: 378
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
Upvotes: 2
Views: 684
Reputation: 149335
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
Upvotes: 2