close

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 = quot;=NOW()quot;
ActiveCell.Copy
Selection.PasteSpecial Paste:=xlPasteValues
Selection.NumberFormat = quot;hh:mm:ssquot;
ActiveSheet.Shapes(Application.Caller).Delete

End SubI 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
try this , hope it helps

change quot;bquot; 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 = quot;bquot; amp; timerow

Do While Range(nextfree) lt;gt; 0
timerow = timerow 1
nextfree = quot;bquot; amp; timerow
Loop

Range(nextfree).Select
ActiveCell.FormulaR1C1 = quot;=NOW()quot;
ActiveCell.Copy
Selection.PasteSpecial Paste:=xlPasteValues
Selection.NumberFormat = quot;hh:mmquot;quot;alexfthequot; wrote:

gt; I am trying to simplify a timetable to mimic several functions of a
gt; stopwatch. Currently I have the macro below:
gt;
gt; Sub Timestamp()
gt; '
gt; ' Timestamp Macro
gt; ' Macro recorded 3/9/2006 by Alex
gt; '
gt; ' Keyboard Shortcut: Ctrl t
gt; '
gt; Dim sAddress As String
gt; sAddress = ActiveSheet.Shapes(Application.Caller).TopLeftCell .Address(0,
gt; 0)
gt; Range(sAddress).Select
gt; ActiveCell.FormulaR1C1 = quot;=NOW()quot;
gt; ActiveCell.Copy
gt; Selection.PasteSpecial Paste:=xlPasteValues
gt; Selection.NumberFormat = quot;hh:mm:ssquot;
gt; ActiveSheet.Shapes(Application.Caller).Delete
gt;
gt; End Sub
gt;
gt;
gt; I want to get this operating on a single key instead of clicking a different
gt; icon for each cell...
gt;
gt; Is there any way to attach it to a cell itself rather than the image? (to
gt; allow the macro to run on striking enter)
gt;
gt; Or
gt;
gt; Is there a way to allow the application caller to regenerate in a remote
gt; location and prepare to perform the action on the next cell down? (would
gt; create a large alarm clock icon in the corner and have it insert a timestamp
gt; in a cell, then clicking the icon again inserts the timestamp one cell below
gt; the previous timestamp and so on...)
gt;
gt; Thanks
gt;
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()