I'm trying to log all of the information processed by a form I have. Each week the form would be updated and I want to keep a log of the data contained in it. Below I have scripted the data being transferred from the form to the Data Log however it is set to a specific row.
Sub DataLog()
'
' DataLog Macro
' Record sales in the data log.
'
'
Sheets("Cell History").Select
Range("A7").Select
ActiveCell.FormulaR1C1 = "=Form!R[-6]C[3]"
Range("C7").Select
ActiveCell.FormulaR1C1 = "=Form!RC[2]"
Range("D7").Select
ActiveCell.FormulaR1C1 = "=Form!R[1]C[1]"
Range("E7").Select
ActiveCell.FormulaR1C1 = "=Form!R[2]C"
Range("F7").Select
ActiveCell.FormulaR1C1 = "=Form!R[3]C[-1]"
Range("G7").Select
ActiveCell.FormulaR1C1 = "=Form!R[4]C[-2]"
Range("H7").Select
ActiveCell.FormulaR1C1 = "=Form!R[5]C[-3]"
Range("I7").Select
ActiveCell.FormulaR1C1 = "=Form!R[6]C[-4]"
Range("J7").Select
ActiveCell.FormulaR1C1 = "=Form!R[7]C[-5]"
Range("K7").Select
ActiveCell.FormulaR1C1 = "=Form!R[8]C[-6]"
Range("L7").Select
ActiveCell.FormulaR1C1 = "=Form!R[9]C[-7]"
Range("N7").Select
ActiveCell.FormulaR1C1 = "=Form!RC[-3]"
Range("O7").Select
ActiveCell.FormulaR1C1 = "=Form!R[1]C[-4]"
Range("P7").Select
ActiveCell.FormulaR1C1 = "=Form!R[2]C[-5]"
Range("Q7").Select
ActiveCell.FormulaR1C1 = "=Form!R[3]C[-6]"
Range("R7").Select
ActiveCell.FormulaR1C1 = "=Form!R[4]C[-7]"
Range("S7").Select
ActiveCell.FormulaR1C1 = "=Form!R[5]C[-8]"
Range("T7").Select
ActiveCell.FormulaR1C1 = "=Form!R[6]C[-9]"
Range("U7").Select
ActiveCell.FormulaR1C1 = "=Form!R[7]C[-10]"
Range("V7").Select
ActiveCell.FormulaR1C1 = "=Form!R[8]C[-11]"
Range("X7").Select
ActiveCell.FormulaR1C1 = "=Form!R[13]C[-22]"
Range("Y7").Select
ActiveCell.FormulaR1C1 = "=Form!R[13]C[-22]"
Range("Z7").Select
ActiveCell.FormulaR1C1 = "=Form!R[13]C[-22]"
Range("AA7").Select
ActiveCell.FormulaR1C1 = "=Form!R[13]C[-22]"
End Sub
Because I will be updating it weekly, I was wondering how I can make Excel look for the next empty row, starting from row 7. I'm currently using Excel 2013. All help is greatly appreciated, thanks :)
UPDATE:
I used Andy G's code changing it to:
Dim rng As Range
Set rng = Range("A100000").End(xlUp).Offset(1,0)
rng.Value = "orginal cell location"
I removed the second ".Offset(0,1)" as it moved the cell a second time to the right.
Thanks everyone :)