Now formula problem

G

Guest

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
 
A

Ardus Petus

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
'------------------------------------
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top