I need to permanently store the instantaneous value of some cells, B4 and B5.
My problem is when the cell contents change, so do my stored variables, but I want the variables to retain the values they first pick up when the "Record_Instantaneous_Values" macro is run, even after new data is manually entered into B4 and B5 - basically to build up a permanent record of what value B4 and B5 had whenever the macro is called.
Here's what I have
' Global Variables....
Global FirstCell
Global SecondCell
' ...
Sub Record_Instantaneous_Values
FirstCell = ThisComponent.CurrentController.ActiveSheet.getCellByPosition( 1, 3 )
SecondCell = ThisComponent.CurrentController.ActiveSheet.getCellByPosition( 1, 4 )
End Sub
Sub Peek_at_stored_values
Print "FirstCell = "; FirstCell.value; ", "; "SecondCell = ";SecondCell.value
End Sub
The fact there's an "undo" function in LO, means cell contents at a particular instant can be stored (in some array presumably). While not wanting to delve into the depths of that, there must be some simple way to achieve what I need, but how?