Hi, can someone help me adjust this code so that way only unique values would show up?
Thanks for trying to help, I'm new to VBA so I don't know everything.
VBA Code:
Function searchPropertyName(textsearch As String)
Dim i As Long
Dim x As Boolean
Dim xvalue As String
Me.ListBox1.Clear
For i = lbl_tipRow.caption To 5501
xvalue = Cells(i, lbl_tipCol).value
' If UCase(Left(valor_celula, Len(textsearch))) = UCase(valor_pesq) Then
If LCase(xvalue) Like "*" & LCase(textsearch) & "*" Then 'LCase(
If x = False Then
Me.ListBox1.Visible = True
x = True
End If
If xvalue <> "" Then
Me.ListBox1.AddItem xvalue
End If
If Me.ListBox1.ListCount >= 20 Then
Me.ListBox1.Height = 160
Else
Me.ListBox1.Height = Me.ListBox1.ListCount * 12 + 2 '9.75 + 8 '32
End If
End If
Next
If Me.ListBox1.ListCount <= 0 Then
Me.ListBox1.Visible = False
End If
End Function
Thanks for trying to help, I'm new to VBA so I don't know everything.