O meu loop só encontra o valor quando tem letras e números.
Pq quando eu coloco so numeros ele não encontra?
Private Sub CommandButton1_Click()
Sheets("BD").Select
Range("A1").Select
Dim LinhaAtual As Integer
Dim ultimalinha2 As Long
ultimalinha2 = Folha1.Cells(Rows.Count, 1).End(xlUp).Row
If cxtconsulta.Text <> "" Then
contador = 0
Do While ActiveCell.Value <> cxtconsulta.Value And contador < ultimalinha2
ActiveCell.Offset(1, 0).Select
contador = contador + 1
Loop
End If
If ActiveCell.Value = cxtconsulta.Value Then
ListBox1.Clear
LinhaAtual = ActiveCell.Row
ListBox1.AddItem Folha1.Range("A" & LinhaAtual)
ListBox1.List(ListBox1.ListCount - 1, 1) = Folha1.Range("C" & LinhaAtual)
ListBox1.List(ListBox1.ListCount - 1, 2) = Folha1.Range("D" & LinhaAtual)
ListBox1.List(ListBox1.ListCount - 1, 3) = Folha1.Range("G" & LinhaAtual)
ListBox1.List(ListBox1.ListCount - 1, 4) = Folha1.Range("H" & LinhaAtual)
ListBox1.List(ListBox1.ListCount - 1, 5) = Folha1.Range("I" & LinhaAtual)
ListBox1.List(ListBox1.ListCount - 1, 6) = Folha1.Range("J" & LinhaAtual)
ListBox1.List(ListBox1.ListCount - 1, 7) = Folha1.Range("O" & LinhaAtual)
Else
MsgBox "Registro não localizado!", vbCritical, "Erro"
End If