Jump to content

Excel vlookup help


Recommended Posts

Hi there,

Need some help.

I need to use vlookup to return a variable. Can someone assist with the Syntax?

Here's what I am trying to do.

My program should initially look at an entry in the registry for "Code"

$var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Remote\", "Code")

once the variable is read to Memory for $var, I need to use the entry for my vlookup to look for a corresponding entry on an excel spreadsheet related to the "Code" and display the entry on a Messagebox.

On the excel spreadsheet, the vlookup parameter should be

=vlookup($var,A:B,2,False) ; =vlookup (the Variable "Code",Column A:Column B,index Column 2, "False" to display the exact entry on Column 2 related to "Code" found)

any ideas out there? Please advise. Thanks very much !

Link to comment
Share on other sites

In Autoit the function would look like:

$Filename = "workboob.xls"
$RegValue = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Remote\", "Code")
$oExcel = excel object
$test = $oExcel.Application.Evaluate("VLOOKUP($RegValue&",'["&$Filename&"]Sheet'!$A:$B",1,FALSE)")
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...