I'm hoping someone can tell me what I'm missing with this one. I tried to check with AI but it wants me to copy/paste and I'm getting a "Method not allowed" error.
I'm trying to copy values on "Source Sheet", of two cells offset in the same row of my ActiveCell to the next available cells after rows 50 of the D and E columns of "DestinationSheet". This is what I have but it seems that no matter where I put the 2nd End if, it either wont run (if at the end) or it wont do the second transfer. I've tried doing with one LastRow reference and I'm getting the same result as the two. AI is telling me to do it with one LastRow reference but to copy and paste both, but I'm getting a "method not allowed" error that way. They seem to run a little faster when doing it destination=source so if that's possible I'd like to stick with that. I'm tempted to try to just have it run a second macro when it's done with column D, but I'd like to learn to do it the right way.
Dim LastRow as Long
Dim LastRow2 as Long
LastRow =Sheets("Destinationsheet").Cells(Rows.Count, 4).End(xlUp).Row +1
LastRow2 =Sheets("Destinationsheet").Cells(Rows.Count, 4).End(xlUp).Row +1
If LastRow <= 50 Then
LastRow = 51
End If
If Last Row2 <= 50 Then
LastRow2 = 51
End If
Sheets("Destinationsheet").Range("D" & LastRow) = ActiveCell.Offset (0, 2).Value
Sheets("Destinationsheet").Range("E" & LastRow) = ActiveCell.Offset (0, 8).Value
End Sub
Bookmarks