raghuprabhu
New Member
- Joined
- Apr 8, 2017
- Messages
- 7
Good evening All,
I have a form with 2 combo boxes.
For the first combo box, combobox1, I have has unique list from Column A as record source using the following code
How do I change it to include a unique list as source for the second combo box, combobox2 from column E?
Thank you
Regards
Raghu Prabhu
From Chilly Melbourne.
I have a form with 2 combo boxes.
For the first combo box, combobox1, I have has unique list from Column A as record source using the following code
Code:
Private Sub UserForm_Initialize()
Dim myCollection As Collection
Dim cell As Range
On Error Resume Next
Set myCollection = New Collection
With combobox1
.Clear
For Each cell In Range("A2:A" & Cells(Rows.Count, 1).End(xlUp).Row)
If Len(cell) <> 0 Then
Err.Clear
myCollection.Add cell.Value, cell.Value
If Err.Number = 0 Then .AddItem cell.Value
End If
Next cell
End With
combobox1.ListIndex = 0
End Sub
How do I change it to include a unique list as source for the second combo box, combobox2 from column E?
Thank you
Regards
Raghu Prabhu
From Chilly Melbourne.