Solved VBA to use PasteSpecial instead of Paste Destination

Microsoft Excel 2010 - complete product...
September 29, 2015 at 08:13:46
Specs: Windows 10
Hi,

I have the following macro that will copy and paste form one worksheet to another. I would like change this to paste the values and I have not been able to figure out how.

Sub CopyColumns()

Dim lastrow As Long, erow As Long, i As Long

lastrow = Sheet2.Cells(Rows.Count, 1).End(xlUp).Row
For i = 6 To lastrow
Sheet2.Cells(i, 8).Copy
erow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row

Sheet2.Paste Destination:=Worksheets("Datasheet to Update Timberline").Cells(erow, 1)

Sheet2.Cells(i, 4).Copy
Sheet2.Paste Destination:=Worksheets("Datasheet to Update Timberline").Cells(erow, 2)


Sheet2.Cells(i, 2).Copy
Sheet2.Paste Destination:=Worksheets("Datasheet to Update Timberline").Cells(erow, 3)

Next i

Application.CutCopyMode = False
Sheet1.Columns.AutoFit
Range("A1").Select

End Sub

Any suggestions would be helpful or if there is a better way to accomplish this I am open to those suggestions as well.

Thank you,
Sandi


See More: VBA to use PasteSpecial instead of Paste Destination

Report •


#1
September 29, 2015 at 12:34:09
✔ Best Answer
Is this what you are looking for?


Sheet2.Cells(i, 4).Copy
  Worksheets("Datasheet to Update Timberline").Cells(erow, 2).PasteSpecial _
                   Paste:=xlPasteValues

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#2
September 29, 2015 at 12:44:40
Wow, that is perfect It I tried so many different versions.

Thank you so much!
Sandi


Report •
Related Solutions


Ask Question