Originally Posted by
RINCONPAUL
SamT: Runtime error 1004 Application defined or object defined error
.Rows(5). Copy .Rows(.Cells(Rows.Count, "7").End(xlUp).Row + 1)
There ain't no such Column letter as "7"
Did you mean Column "G" which is Column #7?
OK, it looks like Column "C" is always used, ie, never empty
Sub SamT
With Sheets("Data")
.Rows(5). Copy .Rows(.Cells(Rows.Count, "C").End(xlUp).Row + 1)
End With
End Sub
Whenever this code is run, it will copy Row #5 to the bottom.
ie if data is populating rows 7 to 24, then on next refresh it will paste into row 25.
Except when the "Bottom" is Row #5, then it will copy it to Row #6.
If that is a problem then use this longer version.
Sub SamT
Dim NR As Long 'NR stands for Next Row
With Sheets("Data")
NR = .Cells(Rows.Count, "C").End(xlUp).Row + 1
If NR = 6 then NR = 7 'Never paste to Row #6
.Rows(5).Copy .Rows(NR)
End With
End Sub