Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Jul 2006
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Put Vloopup in VBA coding (2003)

    Is is possible to put Vloopup in a vba coding in macro. I would like to convert the string “cr” to a number so the Vloop works. See screenshot.
    Attached Images Attached Images

  2. #2
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Put Vloopup in VBA coding (2003)

    Try
    Variable = Application.WorksheetFunction.VLookup(lookup_value , table_array, col_index_num, range_lookup)
    Regards
    Don

  3. #3
    4 Star Lounger
    Join Date
    Jul 2006
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Put Vloopup in VBA coding (2003)

    Thanks for that,

    I cannot workout what application.worksheetfunction means, l have completed all the other aspects of the formula.
    Can you tell me what needs to go in these fields? Would it be excel.vlookup , as excel is the application and vlookup is function?

    CR = application.worksheetfunction.vlookup(CR, =VLOOKUP("CR",'[IDND test .xls]Customer Completed'!$C:$C),B:B,True)

  4. #4
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Put Vloopup in VBA coding (2003)

    The statement
    "Variable = Application.WorksheetFunction.VLookup(lookup_value , table_array, col_index_num, range_lookup)
    "
    can be read as follows:
    <UL><LI>" Variable " is the name of the variable to which you want to assign the lookup value
    <LI>" Application.WorksheetFunction.VLookup " says that we want to use the Excel worksheet function Vlookup
    <LI>" lookup_value " is the value you want to compare against the first column of the array
    <LI>" table_array " is the array holding your data
    <LI>" col_index_num " is the column that holds the value you want to have returned
    <LI>" range_lookup " determines whether the lookup requires an exact or approximate match[/list]The rules of use are identical to those used in a worksheet cell.

    The attached file provides both a VBA and worksheet example
    Attached Files Attached Files
    Regards
    Don

Posting Permissions

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