PDA

View Full Version : Solved: Paste to latest empty cell



parscon
02-16-2012, 09:35 AM
I have a VBA Code and i want to paste the data to latest blank cell of another sheet :

that mean in column B in sheet 2 i have some data and now i want to copy data from sheet 1 to latest blank column of sheet 2 on column B .




With Sheets("sheet1")
.Range(.Range("B1"), .Range("B65536").End(xlUp)).Copy
End With
Sheets("sheet2").[B65536].End(xlUp)(1).PasteSpecial Paste:=xlValues

Bob Phillips
02-16-2012, 09:52 AM
Last blank column or last blank row in column B. Your explanation is jumbled, and what is the deal with that code, it works or it doesn't work?

parscon
02-16-2012, 09:54 AM
I want to copy to latest blank cell on column B .

and my code just copy to another column but do not copy to latest blank cell of another sheet .

Bob Phillips
02-16-2012, 10:34 AM
With Worksheets("sheet1")
.Range(.Range("B1"), .Cells(.Rows.count, "B").End(xlUp)).Copy
End With
With Worksheets("sheet2")
.Cells(.Rows.count, "B").End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlValues
End With