VBA - CopyTo with values not formula's

Sayth

Board Regular
Joined
Jun 4, 2010
Messages
213
I am using this code to copy from one sheet to another. They are both in the same workbook.
Code:
    lngLastRow = Cells(1, 1).End(xlDown).Row
    With Sheets("Datasheet")
        .Range("C1:F" & lngLastRow).Copy Destination:=Sheets("Sheet3").Range("A1")
        .Range("M1:N" & lngLastRow).Copy Destination:=Sheets("Sheet3").Range("E1")
        .Range("BJ1:BU" & lngLastRow).Copy Destination:=Sheets("Sheet3").Range("H1")
        .Range("BY1:BY" & lngLastRow).Copy Destination:=Sheets("Sheet3").Range("T1")
        .Range("BX1:BY" & lngLastRow).Copy Destination:=Sheets("Sheet3").Range("U1")
        .Range("CA1:CP" & lngLastRow).Copy Destination:=Sheets("Sheet3").Range("V1")
    End With

I want the values to copy not the formulas. On the sheet I am copying to I have Zero's everywhere and I can see that the formula's don't reference. I don't really need the formula's they are still on the other sheet. The errors look like
Code:
=IFERROR((#REF!-(((#REF!/SUM((#REF!*1.2),#REF!,(A2*0.8)))*SUM(#REF!,(A2*0.8)))*0.8))/#REF!*(#REF!/(#REF!-(#REF!+(A2*0.8)))),0)
 
Try like this

Code:
lngLastRow = Cells(1, 1).End(xlDown).Row
    With Sheets("Datasheet")
        .Range("C1:F" & lngLastRow).Copy
        Sheets("Sheet3").Range("A1").PasteSpecial Paste:=xlPasteValues
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top