View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Current Time Function

You can't do it with a formula

"Shaun" wrote:

Hi Mike,

Thanks for your reply, But i need to get the result using formula, whether
it's possible?

Thanks

Shaun

"Mike H" wrote:

Hi,

Right click your sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A1:A100")) Is Nothing Then
If UCase(Target.Value) = "M" Then
With Target
.Offset(, 1).Value = Time
.NumberFormat = "hh:mm:ss"
End With
End If
End If
End Sub


Mike

"Shaun" wrote:

I require a FORMULAE for example if i enter "M" in A1 cell then the B1 cell
should display the current time, like this the current time should appear in
B2 cell when i enter "M" in A2 cell.

Example
A1 B1
M 10:53:45

A2 B2
M 10:53:55

Any help on this?

Thanks.