cell

A

ash

i have got a macro which puts the static time in a cell
but i have 2 click on the cell then the macro 2 get the
time into that cell! is there a way i can set it so when
i click on the macro it puts the time in a certain cell
with out me selecting the cell before, i did not recrod
the macro which is wht i cannot do it? please help im no
good at vba! lol
 
J

JE McGimpsey

One way (change the cell reference and time format to suit):

Public Sub EnterTime()
With Range("A1")
.NumberFormat = "hh:mm:ss"
.Value = Time
End With
End Sub
 
Top