ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   NOW Function For Time Changes With Each New Macro (https://www.excelbanter.com/excel-worksheet-functions/92758-now-function-time-changes-each-new-macro.html)

HLD920

NOW Function For Time Changes With Each New Macro
 
I need help. I have created a telephone log and need to log the time that
each of these calls takes. I want to insert a NOW Function in the first two
cells of each telephone call, but when the macro is run for each cell, it
changes them both to the current time. It will continue to change them for
each telephone call to all the same time. How do I get the function NOW to
put in just the time the macro is run, and not every time. I hope this makes
sense!

Gary''s Student

NOW Function For Time Changes With Each New Macro
 
Sub time1()
Set r = Range("A1")
r.Formula = "=NOW()"
End Sub


Sub time2()
Set r = Range("A1")
r.Value = Now()
End Sub

The first method deposits a formula that updates as give goes on.
The second method deposits a value that is static.
--
Gary's Student


"HLD920" wrote:

I need help. I have created a telephone log and need to log the time that
each of these calls takes. I want to insert a NOW Function in the first two
cells of each telephone call, but when the macro is run for each cell, it
changes them both to the current time. It will continue to change them for
each telephone call to all the same time. How do I get the function NOW to
put in just the time the macro is run, and not every time. I hope this makes
sense!



All times are GMT +1. The time now is 02:00 AM.

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