Jump to content
Sign in to follow this  
cadeleon

Excel vlookup help

Recommended Posts

cadeleon

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 !

Share this post


Link to post
Share on other sites
Juvigy

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)")

Share this post


Link to post
Share on other sites
cadeleon

look for excel in the helpfile.

Thanks for your assistance but I cant find anything related to vlookup when I put Excel on the Helpfile.

Share this post


Link to post
Share on other sites
JoHanatCent

Thanks for your assistance but I cant find anything related to vlookup when I put Excel on the Helpfile.

Does this help?

$sAutoItPath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir")
Run(@WindowsDir & "\HH.exe " & $sAutoItPath & "\UDFs3.chm::/html/libfunctions/_ExcelWriteFormula.htm", "", @SW_MAXIMIZE)

Share this post


Link to post
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
Sign in to follow this  

×