I would like to pass a range in a function and use that in a macro but cannot figure out how to do it.
I tried to create a formula in a cell like:
and then a routine like:
Public Function Test(r as com.sun.star.table.CellRange) as String cnt = 0 oEnum = r.createEnumeration() Do while oEnum.hasMoreElements() cnt = cnt + 1 oEnum.nextElement() Loop Test = ">> " & cnt & " " & typename(r) & " " & isObject(r) & " " & IsNull(r) & " " & ThisComponent.Sheets(0).getCellRangeByName("A2:A4").computeFunction(com.sun.star.sheet.GeneralFunction.COUNT) End Function
but no matter what I try I get errors or strange behaviour. Anyone knows how to do this?
thx a lot.