N
ninpo1
Please help correct the following macro. The macro is not currently
reliable. I need this macro to always enter the hours in column A,
minutes in column B and seconds in column C. I need the macro to enter
this information in the lowest numbered row that has no information in
columns A, B and C.
The problem is that the current macro places the information in
different columns and rows each time (it is not repeatable). Any help
with fixing this macro would be greatly appreciated!
Thanks,
Mark
The macro is below:
Sub Macro1()
' Enter_Time_for_Qual_Log Macro
'
' This macro enters the Hours, Minutes & Seconds of
' the current time into the lower left empty cells.
'
ActiveCell.SpecialCells(xlLastCell).Select
SendKeys ("^{LEFT}"), True
SendKeys ("^{UP}"), True
ActiveCell.Offset(1, 0).Range("A1").Select
' SendKeys ("{DOWN}"), True
ActiveCell.FormulaR1C1 = "=HOUR(NOW())"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=MINUTE(NOW())"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=SECOND(NOW())"
ActiveCell.Offset(0, -2).Range("A1:C1").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMod
End Sub
reliable. I need this macro to always enter the hours in column A,
minutes in column B and seconds in column C. I need the macro to enter
this information in the lowest numbered row that has no information in
columns A, B and C.
The problem is that the current macro places the information in
different columns and rows each time (it is not repeatable). Any help
with fixing this macro would be greatly appreciated!
Thanks,
Mark
The macro is below:
Sub Macro1()
' Enter_Time_for_Qual_Log Macro
'
' This macro enters the Hours, Minutes & Seconds of
' the current time into the lower left empty cells.
'
ActiveCell.SpecialCells(xlLastCell).Select
SendKeys ("^{LEFT}"), True
SendKeys ("^{UP}"), True
ActiveCell.Offset(1, 0).Range("A1").Select
' SendKeys ("{DOWN}"), True
ActiveCell.FormulaR1C1 = "=HOUR(NOW())"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=MINUTE(NOW())"
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=SECOND(NOW())"
ActiveCell.Offset(0, -2).Range("A1:C1").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMod
End Sub