PDA

View Full Version : [SOLVED:] Paste copied info one row down daily



bloomington
12-16-2014, 09:50 PM
Hi I have one small issue Im having trouble resolving. Simple one for those who know Im sure.

I have the following code....

Sheets("Sheet1").Select
Range("E3").Copy
Sheets("Sheet2").Select
Range("B2").PasteSpecial
Sheets("Sheet1").Select
Range("E4").Copy
Sheets("Sheet2").Select
Range("c2").PasteSpecial

What I would like to happen is each time I run the macro I want the values from E3 and E4 from Sheet 1 copied and pasted to Sheet 2 B2 and C2 respectively to start and then down one row after that each time. So the location of the source cells never changes, but the rows of the destination cells drops down each time the macro is run (so as to not overwrite previously pasted data).

Thanks

mancubus
12-17-2014, 12:22 AM
hi.
try this:



Dim LastRow As Long

With Worksheets("Sheet2")
LastRow = .Cells(.Rows.Count, "B").End(xlUp).Offset(1).Row
.Range("B" & LastRow).Value = Worksheets("Sheet1").Range("E3").Value
.Range("C" & LastRow).Value = Worksheets("Sheet1").Range("E4").Value
End With

snb
12-17-2014, 03:41 AM
Sub M_snb()
sheets("sheet2").cells(rows.count,2).end(xlup).offset(1).resize(,2)=application.transpose( sheets("Sheet1").range("E3:E4"))
End Sub

bloomington
12-17-2014, 04:50 PM
Thanks to both of you. The solutions you offered worked perfectly. At first I thought there was a problem but it was my error.

Thanks so much for the help!!