Ayuda con VLOOKUP

yoguibubu

New Member
Joined
Feb 19, 2002
Messages
6
Como puedo hacer referencia en el Rango de VLOOKUP a un Rango de otra hoja (en el mismo libro).
Con esto me da error de aplicacion definido por el objeto:
TextProducto.Value = Application.VLookup(UserForm1.ComboBox2.Value, Worksheets("Productos").Range(B6, D179), 3, 0)
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
On 2002-02-20 04:51, yoguibubu wrote:
Como puedo hacer referencia en el Rango de VLOOKUP a un Rango de otra hoja (en el mismo libro).
Con esto me da error de aplicacion definido por el objeto:
TextProducto.Value = Application.VLookup(UserForm1.ComboBox2.Value, Worksheets("Productos").Range(B6, D179), 3, 0)

Es esto lo que está mal:

.Range(B6, D179)

debería ser

.Range("B6","D179")
o
.Range("B6:D179")
 
Upvote 0
Es esto lo que está mal:

.Range(B6, D179)

debería ser

.Range("B6","D179")
o
.Range("B6:D179")

Gracias Juan Pablo:
Debo tener algo mal pues ahora me da el error:
error '-2147352571 (80020005) en tiempo de ejecución:
"Imposible configurar la propiedad value. Tipo incorrecto"

Será del combobox?
This message was edited by Juan Pablo G. on 2002-02-20 09:03
 
Upvote 0
El ComboBox tiene valores numéricos ? Creo que el problema es que el valor de un ComboBox se devuelve, si no me acuerdo mal, como un String, que al compararse con un número, es diferente. Esto podría causar el error en el resultado final.

Si esto es, depronto se podría tratar con

ComboBox2.Value + 0

o

Val(ComboBox2.Value)
 
Upvote 0
[/quote]

Efectivamente Juan Pablo:
El combobox tiene valores numéricos que debía traerlos como String. Con la funcion VAL se arregló todo
Nuevamente gracias
 
Upvote 0

Forum statistics

Threads
1,214,589
Messages
6,120,416
Members
448,960
Latest member
AKSMITH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top