Timestamp Macro

A

alexfthe

I am trying to simplify a timetable to mimic several functions of a
stopwatch. Currently I have the macro below:

Sub Timestamp()
'
' Timestamp Macro
' Macro recorded 3/9/2006 by Alex
'
' Keyboard Shortcut: Ctrl+t
'
Dim sAddress As String
sAddress = ActiveSheet.Shapes(Application.Caller).TopLeftCell.Address(0,
0)
Range(sAddress).Select
ActiveCell.FormulaR1C1 = "=NOW()"
ActiveCell.Copy
Selection.PasteSpecial Paste:=xlPasteValues
Selection.NumberFormat = "hh:mm:ss"
ActiveSheet.Shapes(Application.Caller).Delete

End Sub


I want to get this operating on a single key instead of clicking a different
icon for each cell...

Is there any way to attach it to a cell itself rather than the image? (to
allow the macro to run on striking enter)

Or

Is there a way to allow the application caller to regenerate in a remote
location and prepare to perform the action on the next cell down? (would
create a large alarm clock icon in the corner and have it insert a timestamp
in a cell, then clicking the icon again inserts the timestamp one cell below
the previous timestamp and so on...)

Thanks
 
R

Rich Mcc

try this , hope it helps

change "b" in the 2 nextfree statments to the coloum number where you want
to enter the time



Sub enter_time()

Dim nextfree As String
timerow = 1
nextfree = "b" & timerow

Do While Range(nextfree) <> 0
timerow = timerow + 1
nextfree = "b" & timerow
Loop

Range(nextfree).Select
ActiveCell.FormulaR1C1 = "=NOW()"
ActiveCell.Copy
Selection.PasteSpecial Paste:=xlPasteValues
Selection.NumberFormat = "hh:mm"
 

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