Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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" "alexfthe" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Search, Copy, Paste Macro in Excel | Excel Worksheet Functions | |||
Closing File Error | Excel Discussion (Misc queries) | |||
macro with F9 | Excel Discussion (Misc queries) | |||
Make Alignment options under format cells available as shortcut | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) |