ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Time Stamp (https://www.excelbanter.com/excel-worksheet-functions/120097-time-stamp.html)

DAI

Time Stamp
 
Hello,

I have created a macro to give me start and finish times with the click of a
button,

Function my_now()
Application.Volatile (False)
my_now = Now
End Function

However every now and the all entries are recalculated. (It only happens when
im not looking)

I was under the impression that with the (Application.Volatile (False)) this
could not happen.

Any ideas would be welcome.


Niek Otten

Time Stamp
 
Just leave the line with Application.Volatile out

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"DAI" <u29573@uwe wrote in message news:69d229a7b7d62@uwe...
| Hello,
|
| I have created a macro to give me start and finish times with the click of a
| button,
|
| Function my_now()
| Application.Volatile (False)
| my_now = Now
| End Function
|
| However every now and the all entries are recalculated. (It only happens when
| im not looking)
|
| I was under the impression that with the (Application.Volatile (False)) this
| could not happen.
|
| Any ideas would be welcome.
|



DAI

Time Stamp
 
Niek,

If I did that excel would recalculate the function every time i open the
sheet. Which defeats the purpose of time stamping.


Niek Otten wrote:
Just leave the line with Application.Volatile out

| Hello,
|
[quoted text clipped - 13 lines]
|
| Any ideas would be welcome.



Don Guillett

Time Stamp
 

use a regular sub to click on
sub datestamp()
activecell=date
'or
'range("a2")=date
end sub


--
Don Guillett
SalesAid Software

"DAI" <u29573@uwe wrote in message news:69d229a7b7d62@uwe...
Hello,

I have created a macro to give me start and finish times with the click of
a
button,

Function my_now()
Application.Volatile (False)
my_now = Now
End Function

However every now and the all entries are recalculated. (It only happens
when
im not looking)

I was under the impression that with the (Application.Volatile (False))
this
could not happen.

Any ideas would be welcome.




DAI

Time Stamp
 
Don,

I have limited kowledge of VBA, how woulld I use the instructions you have
given. If you could give a step by step that would be great.


Thank You

Don Guillett wrote:
use a regular sub to click on
sub datestamp()
activecell=date
'or
'range("a2")=date
end sub

Hello,

[quoted text clipped - 16 lines]

Any ideas would be welcome.



Gord Dibben

Time Stamp
 
If you are clicking a button use a macro to insert a static time and not a
Function which can/will change.

Sub NOWTIME()
ActiveCell.Value = Format(Now(), "h:mm:ss AM/PM")
End Sub


Gord Dibben MS Excel MVP

On Sat, 25 Nov 2006 15:43:09 GMT, "DAI" <u29573@uwe wrote:

Hello,

I have created a macro to give me start and finish times with the click of a
button,

Function my_now()
Application.Volatile (False)
my_now = Now
End Function

However every now and the all entries are recalculated. (It only happens when
im not looking)

I was under the impression that with the (Application.Volatile (False)) this
could not happen.

Any ideas would be welcome.



DAI via OfficeKB.com

Time Stamp
 
Gord,

That works well althogh I have canged the format of the date and time.

Sub NOWTIME()
ActiveCell.Value = Format(Now(), "dd/mm/yyyy hh:mm")
End Sub


Thank You


Gord Dibben wrote:
If you are clicking a button use a macro to insert a static time and not a
Function which can/will change.

Sub NOWTIME()
ActiveCell.Value = Format(Now(), "h:mm:ss AM/PM")
End Sub

Gord Dibben MS Excel MVP

Hello,

[quoted text clipped - 13 lines]

Any ideas would be welcome.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200611/1


DAI via OfficeKB.com

Time Stamp
 
Gord,

That works well although I have canged the format of the date and time.

Sub NOWTIME()
ActiveCell.Value = Format(Now(), "dd/mm/yyyy hh:mm")
End Sub


Thank You


Gord Dibben wrote:
If you are clicking a button use a macro to insert a static time and not a
Function which can/will change.

Sub NOWTIME()
ActiveCell.Value = Format(Now(), "h:mm:ss AM/PM")
End Sub

Gord Dibben MS Excel MVP

Hello,

[quoted text clipped - 13 lines]

Any ideas would be welcome.


--
Message posted via http://www.officekb.com


Gord Dibben

Time Stamp
 
Thanks for the feedback.

Alternate non-vba method to enter static date/time in a cell

CTRL + ;..let go of CTRL, hit spacebar then CTRL + SHIFT + ;

Format to suit.


Gord

On Mon, 27 Nov 2006 08:15:39 GMT, "DAI via OfficeKB.com" <u29573@uwe wrote:

Gord,

That works well althogh I have canged the format of the date and time.

Sub NOWTIME()
ActiveCell.Value = Format(Now(), "dd/mm/yyyy hh:mm")
End Sub


Thank You


Gord Dibben wrote:
If you are clicking a button use a macro to insert a static time and not a
Function which can/will change.

Sub NOWTIME()
ActiveCell.Value = Format(Now(), "h:mm:ss AM/PM")
End Sub

Gord Dibben MS Excel MVP

Hello,

[quoted text clipped - 13 lines]

Any ideas would be welcome.


Gord Dibben MS Excel MVP


All times are GMT +1. The time now is 10:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com