stucamps
Board Regular
- Joined
- Jul 3, 2003
- Messages
- 114
I have a combo Box in VBA which with the code below omits any multiple entries:
The problem is when I select the entry I want the Combo Box displays a blank - it doesnt capture the selection I want.
Where am I going wrong???????
Thanks
Stuart
Code:
Private Sub cboManagerName_DropButtonClick()
Dim rng As Range
Dim collNoDupes As New Collection
Dim lng As Long
Dim Item
Dim rngfield As Range
Set rngfield = ThisWorkbook.Sheets("Database").Range("C1:C400")
cboManagerName.Clear
On Error Resume Next
For Each rng In rngfield
collNoDupes.Add rng.Value, CStr(rng.Value)
Next rng
On Error GoTo 0
For Each Item In collNoDupes
cboManagerName.AddItem Item
Next Item
cmdManager.Enabled = True
End Sub
The problem is when I select the entry I want the Combo Box displays a blank - it doesnt capture the selection I want.
Where am I going wrong???????
Thanks
Stuart