[Solved] How to generate the dates and save the value

Discuss the spreadsheet application
Post Reply
cochorol
Posts: 1
Joined: Wed Jul 21, 2021 10:18 am

[Solved] How to generate the dates and save the value

Post by cochorol »

So far I have this:

Code: Select all

IF(ISBLANK(B12); "  ";NOW()) 
but everytime I change the value in another cell different than B12, lets say B13(which is linked to another command like the previous one) all the dates change. How can I generate the date and save the value so it won't change after it's generated? thanks for the help
Last edited by MrProgrammer on Fri Jul 30, 2021 1:46 am, edited 1 time in total.
Reason: Tagged ✓ [Solved]
Openoffice 4.1.9 on Windows 10
User avatar
robleyd
Moderator
Posts: 5055
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: How to generate the dates and save the value

Post by robleyd »

See if this post helps.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.1.2; SlackBuild for 24.2.1 by Eric Hameleers
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: How to generate the dates and save the value

Post by Villeroy »

[Calc,Python,Basic,Base] Several ways to time stamps
Download the Writer document to a trusted directory allowing execution of embedded macros and push the install button. See Tools --> Options --> Security, button [Macro Security]. There you choose the highest security level and add one or more directories where you store trusted documents like this one. This must not be your default directory for downloads because this directory gets anything downloaded from the internet. You should explicitly move your trusted documents into trusted directories.
The macro to insert the time stamp into the active cell can be found under MyMacros/pyCalc/NowToCalcCell/NowToActiveCell. Assign a keyboard shortcut to it or a button or a menu entry. It inserts the current date-time value down to milliseconds, leaving the formatting up to you. When used with a cell having the default number format, the macro applies the default date-time format.

Advantages of this solution:
Works locale independently with any setting for the zero date.
Includes milliseconds.
The active cell macro writes to the currently focussed cell (aka "active cell"), no matter what else may be selected.
The macro does not touch any preset number format unless the cell has the default format. The default format will be changed to the locale dependent default format for time stamps.

LibreOffice has two built-in shortcuts to insert the current date or the current time with milliseconds into the active cell, however there is no shortcut for the timestamp. Therefore, this macro may also be useful with LibreOffice. The latest version of my macro tries to work in the same way with the combined date-time as the built-in routines for date or time.
https://www.libreoffice.org/discover/li ... penoffice/
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply