I have recorded the following VBA macro in Excel
Sub EnterDate()
'
' EnterDate Macro
' Enter date at any point in a worksheet and move cursor down
'
' Keyboard Shortcut: Ctrl+x
'
ActiveCell.FormulaR1C1 = "12/15/2014"
ActiveCell.Offset(1, 0).Range("A1").Select
End Sub
What I need to be able to do is to be able to insert different years, months, and days, and loop back to repeat the process in the cells below. The above code only inserts the defined date. I would like to enter month, hit [ENTER], enter day, hit [ENTER], enter year hit [ENTER], display the date and move down to the next cell, repeating the loop until stopping execution.
ActiveCell.Offset(1, 0).Range("A1").Selectin nonsensical. Starting from the active cell, you move down one row and then select cellA1? Did you meanRange("A1").Offset(1,0)instead?