Hello All,
I am stuck while adding multipage dynamically to a blank userform.
First I tried following code:
Above code added a multi page with two pages. Now I changed the code to below:
Thanks
Angsuman
I am stuck while adding multipage dynamically to a blank userform.
First I tried following code:
Code:
Dim HolCalMulPg As MultiPage
Set HolCalMulPg = Me.Controls.Add("Forms.MultiPage.1")
Above code added a multi page with two pages. Now I changed the code to below:
Code:
Dim HolCalMulPg As MultiPage
Dim NumPages As Long
NumPages = UBound(CostCollectorArray, 1) <------- CostCollectorArray is array with two rows and 3 columns. Column 1 of each row
contains name of each page of the multipage
For i = 1 To NumPages
Set HolCalMulPg = Me.Controls.Add("Forms.MultiPage.1")
Next
Above code still adds two pages to multipage. In above example NumPages = 2 and result is ok but I tried changing the value of NumPages to 3 but number of pages added is 2 which seems default. How do I ensure that number of pages added is same as the the value in NumPages.
Thanks
Angsuman