Macro for Time Recording

K

karim

hi,

I want to record current time into cell(A2) when cell (A1) does contain
value with macro.
I want to record it automaticaly without using any shortkey or tab,

Please help.
 
G

Gord Dibben

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo enditall
Application.EnableEvents = False
If Me.Range("A1").Value <> "" Then
Me.Range("A2").Value = Format(Now, "hh:mm:ss")
End If
enditall:
Application.EnableEvents = True
End Sub

Placed in the worksheet module.


Gord Dibben MS Excel MVP
 

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