Av8tordude
Well-known Member
- Joined
- Oct 13, 2007
- Messages
- 1,074
- Office Version
- 2019
- Platform
- Windows
I have the code that fills the combo box with names. Problem if there are no names, the header is displayed in the combo box. If there are names, the header does not show. I would like to exclude the header if there are no names populating the combo box.
VBA Code:
cbName.Clear
For Each rCell In Wks.Range("A7", Wks.Cells(Rows.Count, "A").End(xlUp))
If Not Dic.exists(rCell.Value) Then
Dic.Add rCell.Value, Nothing
End If
Next rCell
For Each Key In Dic
cbName.AddItem Key
Next