Consulting

Results 1 to 10 of 10

Thread: Vlookup

  1. #1
    VBAX Regular
    Joined
    Mar 2005
    Posts
    31
    Location

    Vlookup

    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.

  2. #2
    Quote Originally Posted by IVY440
    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

  3. #3
    VBAX Regular
    Joined
    Mar 2005
    Posts
    31
    Location
    Quote Originally Posted by Piranha
    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

  4. #4
    Quote Originally Posted by IVY440
    Sheet represents here the name of the sheet.
    It's the best thing to select the column.
    Please help me
    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

  5. #5
    VBAX Regular
    Joined
    Mar 2005
    Posts
    31
    Location
    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.

  6. #6
    Quote Originally Posted by IVY440
    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

  7. #7
    Quote Originally Posted by IVY440
    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.

  8. #8
    VBAX Regular
    Joined
    Mar 2005
    Posts
    31
    Location
    No it's just a variable.

    Value = InputBox("...?")
    Land = WorksheetFunction.VLookup(Value,???)
    And I didn't notice your latest post
    Thanx for asking the questions, now maybe it's more clear to others.

  9. #9
    VBAX Contributor
    Joined
    Jul 2005
    Posts
    169
    Location
    Quote Originally Posted by IVY440
    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

  10. #10
    VBAX Regular
    Joined
    Mar 2005
    Posts
    31
    Location
    jindon, thanx again for the terrific help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •