Try this
Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
Private Const LB_FINDSTRINGEXACT = &H1A2
Private Sub AddToListbox(strListBItem As String, LB As ListBox)
Dim lngListIndex As Long
' lngListIndex is the ListIndex if the item is found
lngListIndex = SendMessage(LB.hwnd, LB_FINDSTRINGEXACT, -1, ByVal strListBItem)
If lngListIndex = -1 Then
LB.AddItem strListBItem
Else
MsgBox strListBItem & " is already in the Listbox"
Exit Sub
End If
End Sub
Private Sub Command1_Click()
AddToListBox Text1.Text, List1
End Sub