VLookup Worksheet Function In Macro

  • I am using a userform to creating a summary of a big spreadsheet. I want to use the vlookup function on the userform but I don't know what to do that.

    How would I incorporate the vlookup on the userform?


    I found the solution: application.worksheetfunction.vlookup("Balt-Yard", Range("C3:G7",3,false) but I am getting a run-time error "Unable to get Vlookup Property of Worksheetfunction Class".

    How do I resolve this issue. Is it something wrong with the code or I need to install a dll?

  • Re: Using VLookup Worksheet function from a Userform

    Hi bearcub,

    It's because you VLookup is failing.
    Try the same thing in the worksheet and see what you get.

    You need to build error handling around you use of the function.
    Here's a small example.


  • Re: Using VLookup Worksheet function from a Userform


    I found out that I had didn't have enough spaces in the first argument.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!