Named Range and print

In Excel I can assign the code below as a Named Range to define a dynamic print area, and then assign the Named Range under Print Range.

If I try to do the same in LibreOffice Calc it doesn’t work; I can’t see the Named Range when I choose Choose Format - Print Ranges - Edit.

Anyone that have any Idea what to do?

The code is

OFFSET($Sheet2.$A$1;0;0;(COUNT($Sheet2.$D:$D)+1);4)

Hello @abrj

Looks like it is currently not possible to use Named Range, which is defined using formula expression, as a predefined Print Range. Have tested several different formulas returning cell or cell ranges - no success. Please see this topic and this enhancement request. So no changes from year 2011…

If you define a named range and select the checkbox Print range under Range option , you will get offered this named range when editing print ranges.
However, a named range based on a calculated reference (like with OFFSET) is not offered as a print range then, though the setting is not rejected, and the range itself is defined and functional. At least “not rejected” I would judge to be a bug. You may file this inconsistency as a bug or your hoped-for dynamic print area as an enhancement to https://bugs.documentfoundation.org.
Without waiting for a new feature you can write user code for the functionality. Each sheet has the properties
.PrintAreas (Array of CellRangeAddress)
.PrintTitleColumns (Boolean) and .TitleColumns (CellRangeASddress)
.PrintTitleRows (Boolean) and .TitleRows (CellRangeAddress)
and you can set the respective Boolean values and CellRangeAddress_es from a Sub or a Function in Basic e.g…