Initialize all controls on each page of multi-page userform

haseft

Active Member
Joined
Jun 10, 2014
Messages
321
hi,
have problrm,
1st page is not initialized,
when 2nd page is clicked its initialized,
but, when I switch back to page 1, its initialized.

the correct way mast be: when I open userform it must show page1 (0) and when I click on combobox cbWorker it skould show "A","B","C" and cbCountry must skow "x","y","z".
help with this please,

VBA Code:
Private Sub UserForm_Initialze()
   me.MultiPage1.value=0
End Sub

Private Sub MultiPage1_Change()
   Select Case MultiPage1.SelectedItem.index
   Case 0
      cbWorker.list=array("A","B","C")
      cbCountry.list=array("x","y","z")
   Case 1
      cbStatus.list=array("A","B","C","D")
      cbCommission.list=array(1,2,"x","y","z")
   End Select
End Sub
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hi,
try placing your codes in the Intialize event & see if resolves your issue

VBA Code:
Private Sub UserForm_Initialize()
    Me.MultiPage1.Value = 0
    cbWorker.List = Array("A", "B", "C")
    cbCountry.List = Array("x", "y", "z")
    cbStatus.List = Array("A", "B", "C", "D")
    cbCommission.List = Array(1, 2, "x", "y", "z")
End Sub

Dave
 
Upvote 0
Solution
Hi,
try placing your codes in the Intialize event & see if resolves your issue

VBA Code:
Private Sub UserForm_Initialize()
    Me.MultiPage1.Value = 0
    cbWorker.List = Array("A", "B", "C")
    cbCountry.List = Array("x", "y", "z")
    cbStatus.List = Array("A", "B", "C", "D")
    cbCommission.List = Array(1, 2, "x", "y", "z")
End Sub

Dave

thanks dmt32 , it works greate, ? (y)
 
Upvote 0

Forum statistics

Threads
1,214,810
Messages
6,121,690
Members
449,048
Latest member
81jamesacct

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top