displaying time

  • Thread starter Thread starter NeoScythe
  • Start date Start date
N

NeoScythe

the problem is this:
how can i display the current time on cell B2 for example once i pu
any data on cell A2? i tried the =Now() command but once i entere
another entry on cell A3, it also resets the time on cell B2
supposedly it will only display the current on cell B3? do u guys hav
any other formula?

pls help! thnx so much! :
 
One possible way

do tools>options>calculation, check iteration.

In B2 use

=IF(A2="","",IF(B2="",NOW(),B2))
 
You need to use VB with the Static command

Paste this function into a VB Module (ALT+ F11), Insert
Module

Function StatNow()
Static myTime
myTime = Now()
StatNow = myTime
End Function

Call the function like any other i.e =statnow()

The function can be forced to update by Pressing
Ctr + Alt + F9

Regards
Peter
 
Hi
and another solution: Use the worksheet change event: Copy the
following in your worksheet module (right click on the tab name, choose
'Code' from the context menu and paste the code

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Me.Range("A:A")) Is Nothing Then Exit Sub
On Error GoTo CleanUp:
With Target
If .Value <> "" Then
Application.EnableEvents = False
.offset(0,1).value = now
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub
 
Back
Top