I am trying to use now() in a colum to record the time another cell is
changed. Works great until the next cell is changed, instead of
getting a colum of times recording when each cell is entered I end up
with a colum identical times all changing to the time the last cell was
entered. How do I keep the time from changing once my formula enters it
into the cell?
=if(a1lt;gt;quot;quot;,now())--
sigfreund
------------------------------------------------------------------------
sigfreund's Profile: www.excelforum.com/member.php...oamp;userid=32096
View this thread: www.excelforum.com/showthread...hreadid=518856The below code pasted into your worksheet code module
will do fine lt;lt;Modify Range B6:B20 to your Rangegt;gt; before testing,,
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count gt; 1 Then Exit Sub
If Not Intersect(Range(quot;B6:B20quot;), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, 1).ClearContents
Else
With .Offset(0, 1)
.NumberFormat = quot;dd mmm yyyy hh:mm:ssquot;
.Value = Now
End With
End If
Application.EnableEvents = True
End If
End With
End Subquot;sigfreundquot; wrote:
gt;
gt; I am trying to use now() in a colum to record the time another cell is
gt; changed. Works great until the next cell is changed, instead of
gt; getting a colum of times recording when each cell is entered I end up
gt; with a colum identical times all changing to the time the last cell was
gt; entered. How do I keep the time from changing once my formula enters it
gt; into the cell?
gt; =if(a1lt;gt;quot;quot;,now())
gt;
gt;
gt; --
gt; sigfreund
gt; ------------------------------------------------------------------------
gt; sigfreund's Profile: www.excelforum.com/member.php...oamp;userid=32096
gt; View this thread: www.excelforum.com/showthread...hreadid=518856
gt;
gt;
I found a way to keep the time from changing as I enter my data down the
colum. I added a conditional so once a time was entered the formula
went from now() to a direct cell ref to itself.
=IF(L1lt;gt;quot;quot;,IF(K2=quot;quot;,NOW(),K1),quot;quot;)
this is the formula for cell k1--
sigfreund
------------------------------------------------------------------------
sigfreund's Profile: www.excelforum.com/member.php...oamp;userid=32096
View this thread: www.excelforum.com/showthread...hreadid=518856
- Oct 18 Sat 2008 20:46
NOW() keeps changing
close
全站熱搜
留言列表
發表留言