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

a permenent =now() function

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


Joined: 30 Dec 2003
Posts: 10
Location: perak

PostPosted: Mon Apr 05, 2004 11:55 am    Post subject: a permenent =now() function Reply with quote

is there any function that only print the current date and time like what =now() function do?

i cant use now() function coz when on the next day it will show todays date and time but not yesterday.

is there any way to insert current date and time permenently and the date will not change the next time i reopen the spreedsheets?
_________________
L@iSeng
http://www.utarcf.shyper.com/
http://www.sengsquare.shyper.com/
Back to top
View user's profile Send private message Visit poster's website
avantman42
Super User
Super User


Joined: 28 Jul 2003
Posts: 751
Location: Staffordshire, UK

PostPosted: Mon Apr 05, 2004 12:22 pm    Post subject: Reply with quote

As far as I know, there's nothing built-in, but the following thread should give you an answer to your problem:

http://www.oooforum.org/forum/viewtopic.php?t=2171

Russ
Back to top
View user's profile Send private message
dfrench
Moderator
Moderator


Joined: 03 Mar 2003
Posts: 1605
Location: Wellington, New Zealand

PostPosted: Mon Apr 05, 2004 12:27 pm    Post subject: Reply with quote

Not through a standard function. You could provide a user function or use a macro to enter the current date into a cell. For example: This simple macro gets the current date (and time); stores the value in the currently selected cell; formats the value as a date.
Code:
Sub Main
oDoc=stardesktop.getcurrentcomponent()
oSel=oDoc.getCurrentSelection()
oSel.value=Now()  ' insert todays date & time at selection
oSel.NumberFormat=75  ' format selected cell as a date
End Sub

Put this in an OO.o basic macro library, assign it to a keystroke, menu item ...
Back to top
View user's profile Send private message
Guest






PostPosted: Mon Apr 05, 2004 12:37 pm    Post subject: Re: a permenent =now() function Reply with quote

laiseng wrote:
is there any function that only print the current date and time like what =now() function do?

i cant use now() function coz when on the next day it will show todays date and time but not yesterday.

is there any way to insert current date and time permenently and the date will not change the next time i reopen the spreedsheets?


Don't use the function, just type in the date; not an arduous task

David.
Back to top
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Mon Apr 05, 2004 3:13 pm    Post subject: Reply with quote

David (the dfrench one),
Code:
oDoc=stardesktop.getcurrentcomponent()
I needed to change this line to
Code:
oDoc=ThisComponent
in order to run this neat piece of code.

EDIT: I was running your code directly from the IDE where I got an error. I find that it works fine if I do Tools > Macros > Macro > Run. I guess this is an example of what Andrew has been talking about, i.e., when run from the IDE, oDoc gets assigned the IDE instead of the last active document.


Last edited by JohnV on Sun May 09, 2004 7:14 pm; edited 1 time in total
Back to top
View user's profile Send private message
Doug Jenkins
Guest





PostPosted: Mon Apr 05, 2004 4:59 pm    Post subject: A permanent =now() function Reply with quote

Enter =now()
Press F9
Press enter.


BTW if you do this in Excel 2000 it displays in number format, not date.
Back to top
Guest






PostPosted: Tue Apr 06, 2004 6:29 pm    Post subject: Re: A permanent =now() function Reply with quote

[quote="Doug Jenkins"]Enter =now()
Press F9
Press enter.
/quote]

Neat!!

David.
Back to top
rstill
Guest





PostPosted: Sat May 08, 2004 8:50 pm    Post subject: user functions Reply with quote

dfrench wrote:
<snip> You could provide a user function... <snip>


I've been trying to figure out how to do this. Can you point me to instructions?
Back to top
bwolsey
Guest





PostPosted: Fri Jun 25, 2004 8:35 am    Post subject: Re: A permanent =now() function Reply with quote

Doug Jenkins wrote:
Enter =now()
Press F9
Press enter.


Thanks tons for this... It's GREAT. Just what I've been looking for.

Brent
Back to top
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