Created
November 23, 2021 10:25
-
-
Save mniak/62935e028204cd8b3dc4863a4b793320 to your computer and use it in GitHub Desktop.
TimeTracker macro for LibreOffice
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const START_COLUMN = 0 | |
const STOP_COLUMN = 1 | |
const MAX_ROW = 1000 | |
function FormattedDate as string | |
FormattedDate = Format(Now, "yyyy-mm-dd hh:mm:ss") | |
end function | |
sub Checkpoint | |
let sheet = ThisComponent.CurrentController.ActiveSheet | |
let row = 0 | |
let startCell = sheet.getCellByPosition(START_COLUMN, row) | |
let stopCell = sheet.getCellByPosition(STOP_COLUMN, row) | |
do until stopCell.string = "" or row > MAX_ROW | |
startCell = sheet.getCellByPosition(START_COLUMN, row) | |
stopCell = sheet.getCellByPosition(STOP_COLUMN, row) | |
row = row + 1 | |
loop | |
if startCell.string = "" then | |
startCell.string = FormattedDate | |
else | |
stopCell.string = FormattedDate | |
end if | |
end sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment