PDA

View Full Version : [SOLVED] Vlookup



IVY440
08-09-2005, 02:09 AM
Another question.
I want to use the vlookup worksheet function in VBA.
But when I use

Land=Worksheetfunction.Vlookup(Value,Sheet!A:K,2,FALSE)

He gives an error on the sheet A:K part.
"List seperator or )" is the message.
How can I solve this problem?
I also tried it with C[1]:C[10] but the problem remains.

Desert Piranha
08-09-2005, 02:31 AM
Another question.
I want to use the vlookup worksheet function in VBA.
But when I use

Land=Worksheetfunction.Vlookup(Value,Sheet!A:K,2,FALSE)

He gives an error on the sheet A:K part.
"List seperator or )" is the message.
How can I solve this problem?
I also tried it with C[1]:C[10] but the problem remains.
Ivy,
Is "Sheet" the name of a worksheet?
Can you select a column (IE A:K) or do you have to use a cell range (IE A1:K62)?
Dave

IVY440
08-09-2005, 02:33 AM
Ivy,
Is "Sheet" the name of a worksheet?
Can you select a column (IE A:K) or do you have to use a cell range (IE A1:K62)?
Dave

Sheet represents here the name of the sheet.
It's the best thing to select the column.
Please help me :beerchug: :bow:

Desert Piranha
08-09-2005, 02:41 AM
Sheet represents here the name of the sheet.
It's the best thing to select the column.
Please help me :beerchug: :bow:
Ivy,
The "Sheet" its refering to is a different Worksheet than the one where the formula is, Right?
Cause if it is looking up data on the same sheet you would not use (Sheet!), is that right?
Dave

IVY440
08-09-2005, 02:45 AM
I'll try to explain it better.
I have one sheet where I have command buttons and one with all the data.
I want that with one click on the button there appears an inputbox.
If you fill in a value in the inputbox, the macro should look up the value that is next to the entered value on the data sheet. The Inputbox part I already wrote, now the only thing that doesn't work properly is the vlookup part.
I hope I'm clear now.

Desert Piranha
08-09-2005, 02:47 AM
Another question.
I want to use the vlookup worksheet function in VBA.
But when I use

Land=Worksheetfunction.Vlookup(Value,Sheet!A:K,2,FALSE)

He gives an error on the sheet A:K part.
"List seperator or )" is the message.
How can I solve this problem?
I also tried it with C[1]:C[10] but the problem remains.
Ivy,
Nother question. Is the word (Value) a word you are looking for?
If so dosen't it have to be (IE "Value")?
Dave

Desert Piranha
08-09-2005, 02:53 AM
I'll try to explain it better.
I have one sheet where I have command buttons and one with all the data.
I want that with one click on the button there appears an inputbox.
If you fill in a value in the inputbox, the macro should look up the value that is next to the entered value on the data sheet. The Inputbox part I already wrote, now the only thing that doesn't work properly is the vlookup part.
I hope I'm clear now.
Ivy,
OK this was before my last post. I can't help with this one. Sorry.
Dave
P.S. I will watch this thread and learn also.

IVY440
08-09-2005, 02:54 AM
No it's just a variable.


Value = InputBox("...?")
Land = WorksheetFunction.VLookup(Value,???)

And I didn't notice your latest post :rofl:
Thanx for asking the questions, now maybe it's more clear to others. :thumb

jindon
08-09-2005, 03:05 AM
Another question.
I want to use the vlookup worksheet function in VBA.
But when I use

Land=Worksheetfunction.Vlookup(Value,Sheet!A:K,2,FALSE)

He gives an error on the sheet A:K part.
"List seperator or )" is the message.
How can I solve this problem?
I also tried it with C[1]:C[10] but the problem remains.
Hi,
2nd arg must be range, therefore should be like

Sheets("YourSheetName").Range("A:K")

Furthermore, The line Worksheetfunction returns error when it doesn't find match, I mean error is not the result of calculation, but line itself.
Whereas Application.VLookup returns error value as a result of the calcualtion.

Hope this helps

IVY440
08-09-2005, 03:14 AM
jindon, thanx again for the terrific help ;)