PDA

View Full Version : Solved: Capture System Time



rahullambe
12-08-2008, 10:38 AM
Dear friends,

In my excel sheet; I want to assign macro for form button; if I click this button, then I should get system time on the next column of the button.

Attached is the file for your reference.

Please help me.

Thanks.:help

Bob Phillips
12-08-2008, 11:08 AM
Sub Time()
With ActiveCell

.Value = Now
.NumberFormat = "h:mm AM/PM"
End With
End Sub

Paul_Hossler
12-08-2008, 11:11 AM
Maybe ...



Sub Time()
ActiveSheet.Range("D4").Value = Format(Now, "hh:mm ampm")
End Sub


Paul

rahullambe
12-08-2008, 11:59 AM
Maybe ...



Sub Time()
ActiveSheet.Range("D4").Value = Format(Now, "hh:mm ampm")
End Sub


Paul
Thanks;

Its working.........

Thanks a lot..