abdelfattah
Well-known Member
- Joined
- May 3, 2019
- Messages
- 1,429
- Office Version
- 2019
- 2010
- Platform
- Windows
hello
I have this code but the problem shows the duplicated items or blanks so what I would modified and doesn't show duplicated or blanks items
I have this code but the problem shows the duplicated items or blanks so what I would modified and doesn't show duplicated or blanks items
VBA Code:
Private Sub UserForm_Initialize()
Const COL_NUM As Integer = 2 ' Which column you want to access '
Dim ws As Worksheet
Dim i As Long
Dim tbl As ListObject
Set ws = sheet5
Set tbl = ws.ListObjects("CustInfo")
ComboBox1.Clear
With tbl
' Add cell values one at a time to the Combo Box List
For i = 1 To tbl.DataBodyRange.Rows.Count
ComboBox1.AddItem tbl.DataBodyRange.Cells(i, COL_NUM)
Next
End With
end sub