How to make a button that pastes the current time in a cell?


Posted by Liviu P on January 28, 2002 4:53 PM

How to make a button that pastes the current time in a cell?

Iam new to this :)

Please help if you can.
Thanks. Liviu P

Posted by Paul on January 28, 2002 5:10 PM

Why not just use Ctrl shift ; (NT)

Posted by Liviu P on January 28, 2002 5:35 PM

Need a button. Why not just use Ctrl shift ; (NT)

There is no way to make a button. Please help.
Thanks. Liviu P

Posted by Paul on January 28, 2002 6:11 PM

Re: Need a button. Why not just use Ctrl shift ; (NT)

Sub time()
Range("A1").Value = Now
End Sub
assign it to a button

Posted by Marlin on January 30, 2002 3:48 PM

Re: Why not just use Ctrl shift ; (NT)

G'Day,

Try this

Sub TIMESTAMP()

ActiveCell.Select
Selection.FormulaR1C1 = Now()
ActiveCell.Select
Selection.NumberFormat = "h.mm"

End Sub


to do this, you will have to open the VB section, <Alt & F11>, then Insert New Module (if one is not already open!)

HTH

Mark.



Posted by Marlin on January 30, 2002 3:50 PM

Forgot to mention

The previous code I posted will allow you to stamp the time in any cell that is highlighted by the cursor.