Here the code:
Private Sub cmdClear_Click()
cmbTesting.Clear
End Sub
Private Sub cmdLoad_Click()
Dim rowNum As String
Dim currentCellValue As String
Dim foundDupFlag As Boolean
Worksheets("Sheet1").Select
ActiveSheet.Range("A65536").Select
ActiveSheet.Range(Selection, Selection.End(xlUp)).Select
rowNum = ActiveCell.Row
'currentCellValue = ActiveSheet.Range("A1").Value
'cmbTesting.AddItem currentCellValue
For counter = 1 To rowNum
'currentCellValue = ActiveSheet.Range("A1").Value
If Not currentCellValue = ActiveSheet.Range("A" & counter).Value Then
currentCellValue = ActiveSheet.Range("A" & counter).Value
End If
For innerCounter = 1 To counter - 1
If counter = 1 Then
foundDupFlag = False
Exit For
End If
If currentCellValue = ActiveSheet.Range("A" & innerCounter).Value Then
foundDupFlag = True
Exit For
End If
foundDupFlag = False
Next
If Not foundDupFlag Then
cmbTesting.AddItem currentCellValue
End If
Next
End Sub
i tried, it works, but i make 2 buttons just to test it, cmdLoad and cmdClear for loading and clearing the combo box. And data should put on column A, start from Cell A1
Cheers