PDA

View Full Version : Solved: Copying to the next blank cell



Lande
11-09-2007, 12:40 PM
I am trying to devise a macro that copies the values from cells P1:P100 (for example) and then find the next blank cell in column B and paste the values from P there.

Thank you!

Bob Phillips
11-09-2007, 12:43 PM
LastRow = Cells(Rows.Count, "B").End(xlUp).Row
Range("P1:P100").Copy Cells(LastRow+1, "B")

Lande
11-12-2007, 12:55 PM
Thanks! What if I want to do the same thing except I want the column P values to be coming from a different worksheet (So I want P1:P100 on sheet1 to be copied to the first blank cell in column D on sheet2).

Thank you!

Bob Phillips
11-12-2007, 01:08 PM
With Worksheets("Sheet2")
LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
Worksheets("Sheet1").Range("P1:P100").Copy .Cells(LastRow+1, "D")
End With