(CALC) Reference to the previous tab in same doc

Hey, Can I create a reference to the previous tab in Calc? I mean “comparatively”.
If I’m in tab_99 “prev” mean tab_98, if I’m in tab_45 it mean tab_48, etc

Hello @ucancallmesimon,

Please specify:

  1. By “tab”, do you mean the Sheet Tabs at the bottom of the window ?
  2. By “if I’m in tab_45 it mean tab_48”, did you mean: “if I’m in tab_45 it mean tab_44” ?

Yes; if you use relative reference (that is, sheet name without $), it will be relative - i.e., when you copy the cell with formula to another sheet, the formula will reference sheet that is “positioned” relatively to new cell like the one in original cell.

Add @JohnSUN’s SheetName macro from How do I access the current sheet name in formula (to use in INDIRECT) - #3 by JohnSUN by going to Tools → Macros → Organize Macros → LibreOffice Basic.

Then the following formula references cell A1 of the previous page.

=INDIRECT(SHEETNAME(SHEET()-1)&".A1")

Or this:

=INDIRECT(ADDRESS(1;1;4;1;SHEETNAME(SHEET()-1)))

Documentation: INDIRECT, ADDRESS, SHEET.