I have a userform for users to enter data, which is then populated into the spreadsheet.
This spreadsheet is effectively a contacts database.
In column C there is a company name. As a result of having multiple contact for each company, company names are duplicated when I open the userform with a combobox initialised with:
Dim iRow As Long
Dim bNeedMore As Boolean
Dim sName As String
iRow = 11
bNeedMore = True
While bNeedMore = True
iRow = iRow + 1
sName = Trim(Sheets("Sheet1").Cells(iRow, "C"))
If Len(sName) > 0 Then
CompanyComBox.AddItem sName
CompanyComBox.List(CompanyComBox.ListCount - 1, 1) = iRow
Else
bNeedMore = False
End If
Wend
I would like to somehow alter this code to remove duplicates in column C.
Any help is appreciated.
Cheers,
nKife
Bookmarks