Using VBA to add tabs to a multipage useform in excel

Ehudz picture Ehudz · May 9, 2012 · Viewed 11.4k times · Source

I need to find the VBA code to add x number of tabs to a multipage in a userform in excel. I can manually add tabs if I use the visual basic editor, but I want to be able to dynamically add/delete tabs using VBA during runtime.

Thanks

Answer

Siddharth Rout picture Siddharth Rout · May 10, 2012

The Tabs in a MultiPage1 are called Pages and you can add them using

MultiPage1.Pages.Add

You can use the above code in a loop to add pages. Please refer to Excel's inbuilt help for more details

Edit:

Just saw the 2nd part of the question. To delete, say the 1st page use this

MultiPage1.Pages.Remove (0)