spread1 contains some stocktake data
spread2 has IF statements in the cells to show labels(text) and data(numbers) IF the stock items are present in spread1
So spread2 is often mostly (appears) empty if I don't need to order stock.
For ease of reading/faxing (yes, faxing!) I "Hide" the Rows that have null in a specific cell
ie. they appear empty but that's the IF <no data>, ""
Code: Select all
=IF($Stocktake_Calculator.N16="","",$Stocktake_Calculator.N16)
Remembering that the cell isn't actually empty, just a formula printing/resulting in "" (nullstring)
This is my current attempt at a toggle macro
Code: Select all
oSheets = ThisComponent.getSheets()
oSheet1 = oSheets.getByName("Stocktake_Calculator")
oRows= oSheet1.getRows()
for i = 7 to 13 '1st row has index 0 so add 1 to get sheet actual
oRow = oRows.getByIndex(i)
oCell = oSheet1.getCellByPosition(i,2)
If oCell.String = "x" Then
oRow.isVisible = True
Else
oRow.isVisible = False
End If
next i