Boa tarde Galera, sou novo em fóruns então desculpe qualquer erro....
Estou criando uma planilha em VBA para de controle de notas fiscais, porém estou tendo problemas na hora de realizar a pesquisa do documento.
A pesquisa esta funcionando, porém existem documentos com numeração repetida de fornecedores diferentes.
Meu codigo esta da seguinte forma:
Private Sub cmdBuscar_Click()
Me.txtNota.Enabled = False
Me.txtPesquisa.Enabled = True
Me.txtResolvido.Enabled = False
Me.txtCancelada.Enabled = False
Me.txtCnpj.Enabled = False
Me.txtFornecedor.Enabled = False
Me.txtEmissao.Enabled = False
Me.txtVencimento.Enabled = False
Me.txtValor.Enabled = False
Me.txtChave.Enabled = False
Me.txtNatureza.Enabled = False
With Worksheets("Notas").Range("b:b")
Set c = .Find(txtPesquisa, LookIn:=xlValues, LookAt:=xlWhole)
If Not c Is Nothing Then
If (txtNota.Value = "=") Then
txtPesquisa.SetFocus
End If
'c.Activate
Me.lblCod.Caption = c.Offset(0, -1)
Me.txtPesquisa.Value = c.Value
Me.txtNota.Value = c.Offset(0, 0)
Me.txtResolvido.Value = c.Offset(0, 1)
Me.txtCancelada.Value = c.Offset(0, 2)
Me.txtCnpj.Value = c.Offset(0, 3)
Me.txtFornecedor.Value = c.Offset(0, 4)
Me.txtEmissao.Value = c.Offset(0, 5)
Me.txtVencimento.Value = c.Offset(0, 6)
Me.txtValor.Value = c.Offset(0, 7)
Me.txtChave.Value = c.Offset(0, 8)
Me.txtNatureza.Value = c.Offset(0, 9)
Me.txtObservacao.Value = c.Offset(0, 10)
Else
MsgBox "O Documento não pode ser encontrado!", vbCritical, "Aviso"
End If
End With
End Sub