Detectar si un "codigo" existe en una planilla, si existe, informarlo en un Label.
Felices Fiestas..!
La Semana pasada, Dante, me hizo esta macro, que funciona a la perfección:
Private Sub CommandButton1_Click()
'Por.Dante Amor
Set h1 = Sheets("Registro")
Set h2 = Sheets("BasedeDatos")
Set b = h2.Range("C:C").Find(TextBox1, lookat:=xlWhole)
If Not b Is Nothing Then
nom = h2.Cells(b.Row, "B")
Set c = h1.Range("B:B").Find(nom, lookat:=xlWhole)
If c Is Nothing Then
wmax = Application.Max(h1.Columns("A")) + 1
u = h1.Range("A" & Rows.Count).End(xlUp).Row + 1
h1.Cells(u, "A") = wmax
h1.Cells(u, "B") = nom
h1.Cells(u, "C") = TextBox1
h1.Cells(u, "D") = Date & " " & Time
Else
h1.Cells(c.Row, "E") = Date & " " & Time
End If
Else
MsgBox "El código no existe"
End If
End SubAhora, lo que necesito, es que, mientras escribo en el TxtPlaca, vaya "detectando" las coincidencias y, si el "Código" esta en la Planilla, me escriba en un Label, que el movimiento será "SALIRÁ" y si el código no esta en la Planilla, me escriba que el movimiento será: "ENTRARÁ".

1 respuesta
Respuesta de Dante Amor
1