Selected Answer
Hi Halk.
You didn't attach a file so I'm not sure what your form looks like but you should use the Initialize sub to set up the Userform (only). In the attached file, there's a button "Show form" which triggers this:
Private Sub CommandButton1_Click()
UserForm1.Show
End Sub
which triggers this (and populates the 3 comboboxes on my form):
Private Sub UserForm_Initialize()
ListArr = Array("CCL-1004", "CCL-1005", "CCL-1006", "CCL-1007")
ComboBox1.List = ListArr
ComboBox2.List = ListArr
ComboBox3.List = ListArr
End Sub
When ComboBox1 is changed (a value selected), this code runs:
Private Sub ComboBox1_Change()
' send the number to the sub
WriteTB (1)
End Sub
It passes the value 1 to this sub which writes it to TextBox1:
Private Sub WriteTB(n As Long)
' set the textbox value to that sent....
Me.Controls("TextBox" & n).Value = n
End Sub
It works the same for whatever number is passed to it so your other Combobox Change subs are just:
Private Sub ComboBox2_Change()
WriteTB (2)
End Sub
Private Sub ComboBox3_Change()
WriteTB (3)
End Sub
Once your form is populated, the Submit button operates this (where you need to change the bold text with code to do what you want).
Private Sub CommandButton1_Click()
'do whatever with the values of comboboxes etc.
'close
Unload Me
End Sub
Hope this helps.