jugador Posted November 7, 2019 Share Posted November 7, 2019 =INDEX($D$2:$E$11,MATCH(A2,$D$2:$D$11,0),2) Have to use loop to do this or can be done easily by using <Excel.au3> Link to comment Share on other sites More sharing options...
jugador Posted November 7, 2019 Author Share Posted November 7, 2019 (edited) Local $xlup = -4162 Local $iRow = $oWorkbook.ActiveSheet.Range("D65536").End($xlup).Row Local $aResult = _Excel_RangeRead($oWorkbook, Default, $oWorkbook.ActiveSheet.Usedrange.Columns("A:A"), 1) Local $myRange = $oWorkbook.ActiveSheet.Range("D1:D11") For $i = 2 To $iRow If $aResult[$i-1] <> "" $var = $oExcel.Application.Match($aResult[$i-1], $myRange, 0) MsgBox(0, "", $var) EndIf Next Local $var, $oValue Local $oRange = $oExcel.ActiveSheet.Range("D:D") Local $iRow = $oExcel.WorksheetFunction.CountA($oRange) Local $myRange = $oWorkbook.ActiveSheet.Range("D1:D11") For $i = 2 To $iRow If $oWorkBook.ActiveSheet.Range("A" & $i).Value <> "" Then $var = $oExcel.Application.Match($oWorkBook.ActiveSheet.Range("A" & $i).Value, $myRange, 0) $oValue = $oExcel.Application.Index($oWorkBook.ActiveSheet.Range("E1:E11").Value, $var, 1) MsgBox(0, "", $oValue) EndIf Next Edited November 7, 2019 by jugador Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now