How to use the notation a1:a4 when referencing a spreadsheet from a python session

In textual spreadsheets, it is possible to use the notation a1:a4 to indicate all cells a1,a2,a3, and a4.
I can reference a single cell outside the spreadsheet (in a python session for example) using something like sheet-a1, is it possible to write something like sheet-a1:sheet-a4 to indicate all cells in the sheet from a1 to a4, if yes, then how?

Hi @Anas and welcome to the forum. I played a bit with spreadsheets and I have not even been able to get the reference to a cell to work outside a spreadsheet (as you say and as also the help files says). Would you mind sharing a brief document where you do that? To do that, you could open the document with a text editor, then copy its contents and paste them here in a code block (a paragraph whose first and last line consists in three backticks).

Said this—I think I found the definitions for the editing of the spreadsheets in progs/dynamic/calc-table.scm; in particular the function cell-ref-range seems the one that interprets the syntax for cell ranges. But I haven’t been yet able to understand how the code works :slight_smile:: maybe someone else is faster.


Thanks for your response @pireddag
in order to reference the cell outside the sheet (in a python executable for example) I used the following combination:


Here is a sample document:







Thanks for finding the function, I will try looking into it further