VLookup type mismatch

O

Omar

Hi,

I have the next:

Private Sub btn4_Click()

Dim magneto As Range
Dim numero
Dim valor As Variant
Dim existe As Boolean

Sheets("info").Visible = True
Set magneto = Worksheets("info").Range("A2:AY65526")
numero = ufConsulta.cboOrden.Value
existe = protege.existe(CStr(numero))

If existe = True Then
ufConsulta.txt33.Value = Application.VLookup(numero, magneto, 1, falso)
'Orden de reparación
ufConsulta.txt34.Value = Application.VLookup(numero, magneto, 2, falso)
'Número de siniestro
....

When the numero's value is something like "96LP" there's no problem.
However, when the value is like "96", then appears a type mismatch error.

What am I doing wrong?

TiA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top