I have a data entry form on excel and I want to put in the top corner the date and time that the last entry was made by simply making the cell refer to the date and time from the previous record.
A simple formula of ='Sheet 1'!A3 will return the first value, but I want A3 to become A4 then A5 and so on each time the command button is pressed.
I can get VBA to make the contents of the cell equal to the formula required to retrieve the data from the other sheet, so:
Worksheets("Sheet 2").Range("J1") = "='Sheet 1'!A3" but I couldn't work out how to get that line of VB code to increase the '3' by 1 each time.
So I tried turning A3 in to the cordinates of 1,I and then having I increase by one each time, but VBA returns an error and I'm unsure why:
Worksheets("Sheet 2").Range("J1") = "='Sheet 1'!1,3"
Simply, I would like the cell reference in J1 which is referencing A3 in the other sheet to increase by 1 each time the code runs.
Unfortunately I can't attach the file as it would take forever to scrub it of sensitive data. Thanks.
Bookmarks