I am trying to make an Excel macro that asks for the day and then inserts it into the next open cell. here is the code i am trying to use.
Sub Button7_Click() Dim AddName As String AddName = InputBox("Date: Month/Year", "Add Date", "01/00") Sheets("Sheet2").Select Selection.End(xlUp).Select ActiveCell.Offset(1, 0).Range("A1").Select Range("A1").Value = AddName End Sub
It puts the input day in cell A1 no matter what is in it, and then selects the next open cell in row A.
I feel the answer is so simple, but I can't figure it out!
source share