Please help correct this macro! :)

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
 
G

Guest

Try this:

Sub AAAAA()
' Enter_Time_for_Qual_Log Macro
'
' This macro enters the Hours, Minutes & Seconds of
' the current time into the lower left empty cells.
'
Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Value = Hour(Now)
Range("B" & Rows.Count).End(xlUp).Offset(1, 0).Value = Minute(Now)
Range("C" & Rows.Count).End(xlUp).Offset(1, 0).Value = Second(Now)
End Sub

Hope this helps,

Hutch
 

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