Hi, I've search a lot, but I'cant find the way to compare the values of cells located in different workbooks in Excel.
What I need is a string to resolve this: "If the value of current cell in workbook1 is equal to the value of current cell in workbook2 do this..."
I think that I can't handle different workbooks, but maybe there is a way to compare the value of the cells.
Thanks
Excel compare cells value from different workbooks
Re: Excel compare cells value from different workbooks
You could have two COM objects that have each one of the excel files open. Then you can compare cells.
Or you insert a formula in Excel to compare the cells, then you do not even need AHK.
Or you insert a formula in Excel to compare the cells, then you do not even need AHK.
ciao
toralf
toralf
Re: Excel compare cells value from different workbooks
Thanks toralf
oWorkbook:= ComObjActive("D:\TEST_A.xls")
oWorkbook.Sheets("Menu").Select
sleep, 200
oWorkbook1:= ComObjGet("D:\TEST_B.xls")
oWorkbook1.Sheets("Log").Select
Yes, I know, but i need an action if the cells value are equal, so i prefer to use AHK directly.toralf wrote:You could have two COM objects that have each one of the excel files open. Then you can compare cells.
I've tried to make a test with every COM (active, get, exc..), but I'm not able to handle two files, it remind me always an error on the second files.toralf wrote:You could have two COM objects that have each one of the excel files open. Then you can compare cells.
oWorkbook:= ComObjActive("D:\TEST_A.xls")
oWorkbook.Sheets("Menu").Select
sleep, 200
oWorkbook1:= ComObjGet("D:\TEST_B.xls")
oWorkbook1.Sheets("Log").Select
Who is online
Users browsing this forum: No registered users and 155 guests