Welcome to NeoOffice developer notes and announcements
NeoOffice
Developer notes and announcements
 
 

This website is an archive and is no longer active
NeoOffice announcements have moved to the NeoOffice News website


Support
· Forums
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


  
NeoOffice :: View topic - Insert timestamp in Calc
Insert timestamp in Calc
 
   NeoOffice Forum Index -> NeoOffice Releases
View previous topic :: View next topic  
Author Message
OOoops
Blue Pill


Joined: Jan 02, 2005
Posts: 3
Location: Vancouver Canada

PostPosted: Sat Nov 10, 2007 2:22 pm    Post subject: Insert timestamp in Calc

Any clues on how to insert (time stamp) the current date and time into a Calc cell?

The NOW() function will do it but the value is updated when you recalculate the document or each time a cell value is modified.

--marc
Back to top
Jim
Councilperson


Joined: Jun 21, 2003
Posts: 173
Location: Selmer, Tennessee

PostPosted: Sun Nov 11, 2007 7:26 am    Post subject:

Construct your sheet so that the timestamp is properly calculated on opening, but use the TEXT() function like so:
=TEXT(NOW(); "mm/dd/yy hh:mm:ss") - or whatever format you want to use. This cell will be recalculated every time the sheet autocalculates, as you've found.

To fix the date, record a macro:

1) Select the cell containing the time stamp.
2) Choose Tools->Macros->Record macro
3) Choose Edit->Copy
4) Choose Edit->Paste Special...
5) Uncheck the boxes until only the "Strings" choice remains checked.
6) Click the "OK" button.
7) Go to the Macro window and click "Stop Recording"
8) Name the macro. e.g. "TimeStamp"

Test run the macro. Enter TEXT(NOW(); "hh:mm:ss") into a cell, say A1, and copy it. Paste it anywhere on the sheet, e.g. D1. Leave that cell selected. Choose Tools->Macros->Run, and select your TimeStamp macro. D1 should show the previous time stamp, and A1 should show the time at which you executed the macro.

After you've assured that the macro works as expected, assign it to a key shortcut. You can then just open your template, select the timestamped cell, and hit your shortcut key to fix the time and date.

Read up on macros on the OOo forum to find out about how Neo catalogs and makes macros available. It's not intuitive, so don't skip this.

_________________
Jim Plante
MacOS X 10.6.34, MacBook 2GHz C2Duo, 2gb, Neo 3.1.1 p 1
Back to top
Lorinda
Captain Mifune


Joined: Jun 20, 2006
Posts: 2051
Location: Midwest, USA

PostPosted: Sun Nov 11, 2007 11:44 am    Post subject:

I've added this tip to the "New Articles Needed" page of the wiki.

Lorinda
Back to top
hi_RAM
Councilperson


Joined: Feb 16, 2006
Posts: 163
Location: 48°51 N 2° 21 E

PostPosted: Sun Nov 11, 2007 1:40 pm    Post subject:

Jim,

Many thanks for the tip Smile

_________________
Patrick G4 2x867, 2 Go, 10.4.11...
Back to top
OOoops
Blue Pill


Joined: Jan 02, 2005
Posts: 3
Location: Vancouver Canada

PostPosted: Mon Nov 12, 2007 1:44 am    Post subject:

Thanks Jim,

It works.
(Until your reply, I was unsuccessful in fiddling with a QuickSilver trigger to insert date and time via the Services menu.)

Thanks very much, Marc
Back to top
Display posts from previous:   
   NeoOffice Forum Index -> NeoOffice Releases All times are GMT - 7 Hours
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © Planamesa Inc.
NeoOffice is a registered trademark of Planamesa Inc. and may not be used without permission.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.