Code: Select all
=INDEX(B1:B47,MATCH("land",A1:A47,0))
Code: Select all
sub callindex()
dim oFunAccess as object
oFunAccess = createUnoService( "com.sun.star.sheet.FunctionAccess" )
dim oDoc, oSheet, oRange as object
oDoc = ThisComponent
oSheet = oDoc.sheets.getByName("Sheet1")
oRange = oSheet.getCellRangeByName("a1:a47")
dim embedded_formula as string
embedded_formula = "MATCH('land',A1:A47,0)"
num = oFunAccess.CallFunction( "index",array("b1:b47", embedded_formula))
print num
end sub