summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorJean-Pierre Ledure <jp@ledure.be>2022-04-10 17:05:33 +0200
committerJean-Pierre Ledure <jp@ledure.be>2022-04-10 18:06:05 +0200
commit43507de5764732300ae9a35cc570b7722a7e1a80 (patch)
treebaafc5ae05259e433b7d67c43839f6c2392a1917 /svl
parent64046625553ecbfd9fe0661e5b6f48e283a909e0 (diff)
ScriptForge - (SF_Calc) new CompactUp() and CompactLeft() methods
The CompactUp(CompactLeft) method: Delete the rows(columns) of a specified range matching a filter expressed as a formula applied on each row(column). The deleted cells can span whole rows(columns) or be limited to the width(height) of the range. The execution of the method has no effect on the current selection. Args: Range: the range in which cells have to be erased, as a string WholeRow(WholeColumn): when True (default = False), erase whole rows(columns) FilterFormula: the formula to be applied on each row(column). The row(column) is erased when the formula results in True. The formula shall probably involve one or more cells of the first row(column) of the range.. By default, a row is erased when all the cells of the row(column) are empty, i.e. suppose the range is "A1:J200" (width = 10), the default value [for CompactUp] becomes "=(COUNTBLANK(A1:J1)=10)" Returns: A string representing the location of the initial range after compaction, or the zero-length string if the whole range has been deleted. Examples for CompactUp(): newrange = oDoc.CompactUp("SheetX.G1:L10") ' All empty rows of the range are suppressed newrange = oDoc.CompactUp("SheetX.G1:L10", WholeRow := True, _ FilterFormula := "=(G1=""X"")") ' The rows having a "X" in column G are completely suppressed Both methods are available for use from Basic and Python scripts. Change-Id: Ib1269b22bcd189ca86a1bd3bda2c67e895598cb0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132783 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Diffstat (limited to 'svl')
0 files changed, 0 insertions, 0 deletions