Tengo una base de datos y en mi codigo uso el vlookup para traer informacion de esa base a un userform, lo que necesito es incluirle un mensaje de alerta cuando se digite el codigo equivocado y por tanto no se encuentra en la base de datos, alctualemnte si se digita mal lo que hace es sacarme al codigo.
Gracias por su colaboracion...
el codigo es el siguiente
Private Sub CommandButton1_Click()
If Reclamacion = "" Then
Numero_de_Factura = "": Exit Sub
total_facturado_mdqx = "": Exit Sub
total_reclamado_mdqx = "": Exit Sub
Primer_apellido_de_la_victima = "": Exit Sub
Segundo_apellido_de_la_vicitima = "": Exit Sub
Primer_nombre_de_la_victima = "": Exit Sub
Segundo_nombre_de_la_victima = "": Exit Sub
Tipo_de_documentode_identidad_de_la_victima = "": Exit Sub
Buenos dias:
Tengo una base de datos y en mi codigo uso el vlookup para traer informacion de esa base a un userform, lo que necesito es incluirle un mensaje de alerta cuando se digite el codigo equivocado y por tanto no se encuentra en la base de datos, alctualemnte si se digita mal lo que hace es sacarme al codigo.
Gracias por su colaboracion...
el codigo es el siguiente
Private Sub CommandButton1_Click()
If Reclamacion = "" Then
Numero_de_Factura = "": Exit Sub
total_facturado_mdqx = "": Exit Sub
total_reclamado_mdqx = "": Exit Sub
Primer_apellido_de_la_victima = "": Exit Sub
Segundo_apellido_de_la_vicitima = "": Exit Sub
Primer_nombre_de_la_victima = "": Exit Sub
Segundo_nombre_de_la_victima = "": Exit Sub
Tipo_de_documentode_identidad_de_la_victima = "": Exit Sub
Fecha_de_ocurrencia_del_evento = "": Exit Sub
Fecha_de_ingreso = "": Exit Sub
Fecha_de_egreso = "": Exit Sub
End If
Numero_de_Factura = Application.VLookup(Val(Reclamacion), Sheets("DATOS").Range("A2:N20000"), 2, 0)
total_facturado_mdqx = Application.VLookup(Val(Reclamacion), Sheets("DATOS").Range("A2:N20000"), 12, 0)
total_reclamado_mdqx = Application.VLookup(Val(Reclamacion), Sheets("DATOS").Range("A2:N20000"), 13, 0)
Primer_apellido_de_la_victima = Application.VLookup(Val(Reclamacion), Sheets("DATOS").Range("A2:N20000"), 8, 0)
Segundo_apellido_de_la_vicitima = Application.VLookup(Val(Reclamacion), Sheets("DATOS").Range("A2:N20000"), 9, 0)
Primer_nombre_de_la_victima = Application.VLookup(Val(Reclamacion), Sheets("DATOS").Range("A2:N20000"), 10, 0)
Segundo_nombre_de_la_victima = Application.VLookup(Val(Reclamacion), Sheets("DATOS").Range("A2:N20000"), 11, 0)
Tipo_de_documentode_identidad_de_la_victima = Application.VLookup(Val(Reclamacion), Sheets("DATOS").Range("A2:N20000"), 6, 0)
Numero_de_documento_de_la_identidad_de_la_victima = Application.VLookup(Val(Reclamacion), Sheets("DATOS").Range("A2:N20000"), 7, 0)
Fecha_de_ocurrencia_del_evento = Application.VLookup(Val(Reclamacion), Sheets("DATOS").Range("A2:N20000"), 3, 0)
Fecha_de_ingreso = Application.VLookup(Val(Reclamacion), Sheets("DATOS").Range("A2:N20000"), 4, 0)
Fecha_de_egreso = Application.VLookup(Val(Reclamacion), Sheets("DATOS").Range("A2:N20000"), 5, 0)