OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Date and time stamp or Version number

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
Johm
Newbie
Newbie


Joined: 31 Mar 2007
Posts: 3

PostPosted: Sat Mar 31, 2007 3:59 am    Post subject: Date and time stamp or Version number Reply with quote

Hello!

I donīt know what is possible.

When I print a sheet I will have a version number in some Cell.

Maybe the best (I think) is the date/time in a cell when the file i last changed.
(or last printed)

I have seek information how I can use the result under "File/Property"
(Where You can find Creation date, Last modify, Last Printed and so on)

How can I get some information like this in a Cell?

// Jan
Back to top
View user's profile Send private message
Mark B
Super User
Super User


Joined: 16 Feb 2007
Posts: 852
Location: Lincolnshire, UK

PostPosted: Sat Mar 31, 2007 4:30 am    Post subject: Reply with quote

Hi Jan

A simple macro will do the job (it'll put the timestamp in A1 in Sheet1):
Code:

Sub timestamp
oDoc = thiscomponent
oSheet = oDoc.Sheets(0)
oCell = oSheet.getCellRangeByName("A1")
oCell.String = oDoc.DocumentInfo.ModifyDate.Day _
      & "/" & oDoc.DocumentInfo.ModifyDate.Month _
      & "/" & oDoc.DocumentInfo.ModifyDate.Year _
      & " " & oDoc.DocumentInfo.ModifyDate.Hours  _
      & ":" & oDoc.DocumentInfo.ModifyDate.Minutes
End Sub

You can then assign this to the "Print Document" event of the document (via Tools | Customize )
Mark
_________________
Mark B's Articles
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Johm
Newbie
Newbie


Joined: 31 Mar 2007
Posts: 3

PostPosted: Sat Mar 31, 2007 1:33 pm    Post subject: Reply with quote

Thankīs for the code!

Now is the problem:
How can I make the macro (in Calc)?

//Jan
Back to top
View user's profile Send private message
Mark B
Super User
Super User


Joined: 16 Feb 2007
Posts: 852
Location: Lincolnshire, UK

PostPosted: Sun Apr 01, 2007 2:04 am    Post subject: Reply with quote

To add a new macro:

  • Click on Tool| Macros | Organize Macros | OpenOffice.org Basic;
  • Select My Macros | Standard | Module1 and then click Edit;
  • Cut and paste the code above into the new window.

To see it in action click in a spreadsheet, then this window and then press the 'Run Basic' button on the toolbar.

Mark
_________________
Mark B's Articles
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Johm
Newbie
Newbie


Joined: 31 Mar 2007
Posts: 3

PostPosted: Sun Apr 01, 2007 7:47 am    Post subject: Reply with quote

Thankīs a lot, it works fine Laughing

//Jan
Back to top
View user's profile Send private message
teror
Newbie
Newbie


Joined: 17 Apr 2009
Posts: 2

PostPosted: Fri Apr 17, 2009 3:35 pm    Post subject: how cani.... Reply with quote

how can i run a macro with an if...then...stament from another cell?

i want to put a timestamp in a cell when a value has been entered into an adjacent cell

i am doing a survey and entering in prices into one column and i want an automated timestamp to appear next to it when i've entered in the price.

i currently use an if statement to check for a blank cell and then use the Now() function however this updates all previous cells as well. i need the timestamp to stay current after the adjacent cell has been updated.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group