Search code examples
libreofficelibreoffice-calc

Can I refer to the location of the active cell in one worksheet, in another worksheet?


Does LibreOffice Calc have a function which returns the active (clicked) row or cell in a worksheet?

I have a large sheet containing rows of data (called "Data") and another worksheet which displays stuff calculated from a specific row of that sheet with relevant statistical aggregations of data from "data" (this sheet is called "Comparators")

At present I have to enter into "Comparators" the number of a row in "Data" to display. It would be so much nicer if one could simply click on a row or a cell in "Data" and then view the "Comparators" sheet for that click-selected row.

(No interest in Excel-specific answers. It must work in LibreOffice Calc. )


Solution

  • There does not seem to be any spreadsheet function, but it can be done with macro code. Have a look at this link: https://forum.openoffice.org/en/forum/viewtopic.php?t=33400.

    What I would probably do is set up a listener so that the macro runs whenever the "Comparators" sheet is activated. An example of such a listener is shown in my answer here: How to scroll all libreoffice calc spreadsheet sheets together. (Or other ~3D-like ideas).