ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Now formula problem (https://www.excelbanter.com/excel-worksheet-functions/91429-now-formula-problem.html)

Lp12

Now formula problem
 
Hi All,
I want to create a timestamp in A2 cell if there is a value in A1.
I used the Now() function which worked great, but each time i save the
worksheet, the timestamp cell (with the Now formula) changes to the current
date/time.
Is there an alternative to accomplish a stable date-time stamp that will
change only if the user accessed and changed A1?
Thanks a lot in advance


Ardus Petus

Now formula problem
 
Paste the following in your worksheet's code
(right-click on tab, select View code)

HTH
--
AP


'------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
Dim sRng As Range
Set sRng = Range("A1")
If Not Intersect(Target, sRng) Is Nothing Then
sRng.Offset(0, 1).Value = Now
End If
End Sub
'------------------------------------
"Lp12" a écrit dans le message de news:
...
Hi All,
I want to create a timestamp in A2 cell if there is a value in A1.
I used the Now() function which worked great, but each time i save the
worksheet, the timestamp cell (with the Now formula) changes to the
current
date/time.
Is there an alternative to accomplish a stable date-time stamp that will
change only if the user accessed and changed A1?
Thanks a lot in advance




Lp12

Now formula problem
 
Thanks a lot Ardus it works perfectly....Do you know of a way without
programming?

"Ardus Petus" wrote:

Paste the following in your worksheet's code
(right-click on tab, select View code)

HTH
--
AP


'------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
Dim sRng As Range
Set sRng = Range("A1")
If Not Intersect(Target, sRng) Is Nothing Then
sRng.Offset(0, 1).Value = Now
End If
End Sub
'------------------------------------
"Lp12" a écrit dans le message de news:
...
Hi All,
I want to create a timestamp in A2 cell if there is a value in A1.
I used the Now() function which worked great, but each time i save the
worksheet, the timestamp cell (with the Now formula) changes to the
current
date/time.
Is there an alternative to accomplish a stable date-time stamp that will
change only if the user accessed and changed A1?
Thanks a lot in advance





Arvi Laanemets

Now formula problem
 
Hi


"Lp12" wrote in message
...
Thanks a lot Ardus it works perfectly....Do you know of a way without
programming?


Select the cell and press Ctrl+Shift+,


--
Arvi Laanemets
( My real mail address: arvi.laanemets<attarkon.ee )




Lp12

Now formula problem
 
Hi Arvi, Thanks for the answer, but i meant that to solve it with formula and
not programming. I want to automate this and not having the user to press any
button

"Arvi Laanemets" wrote:

Hi


"Lp12" wrote in message
...
Thanks a lot Ardus it works perfectly....Do you know of a way without
programming?


Select the cell and press Ctrl+Shift+,


--
Arvi Laanemets
( My real mail address: arvi.laanemets<attarkon.ee )






All times are GMT +1. The time now is 02:09 PM.

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