.Copy Destination copying Values only (not formulea) [SOLVED]

Dancey_

New Member
Joined
Aug 18, 2010
Messages
41
Hey guys,

Hoping you can help me, I have the following code that copies data from an input sheet to a 'sales database' I have made. The following code works perfectly, but it copies the formula in some of the cells, where I just want the value. For your reference the formula's are =TODAY() and =NOW() to create a time (and date) stamp for the sale.

Here is what I have, but I would like it just copy values please:

Code:
Sub Save()
Workbooks.Open "C:\Documents and Settings\tom.dance\Desktop\Sales Database.xlsm"
ThisWorkbook.Sheets("Sheet1").Range("A2:M2").Copy Destination:=Workbooks("Sales Database.xlsm").Sheets("Sales").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
Workbooks("Sales Database.xlsm").Save
Workbooks("Sales Database.xlsm").Close
ThisWorkbook.Sheets("Sheet1").Range("C2:M2").ClearContents
End Sub
Once again thank you very much for your help!

Cheers
 
Last edited:

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Re: .Copy Destination copying Values only (not formulea)

Try

Code:
Sub Save()
Workbooks.Open "C:\Documents and Settings\tom.dance\Desktop\Sales Database.xlsm"
ThisWorkbook.Sheets("Sheet1").Range("A2:M2").Copy
Workbooks("Sales Database.xlsm").Sheets("Sales").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteValues
Workbooks("Sales Database.xlsm").Save
Workbooks("Sales Database.xlsm").Close
ThisWorkbook.Sheets("Sheet1").Range("C2:M2").ClearContents
End Sub
 
Upvote 0
Re: .Copy Destination copying Values only (not formulea)

Try

Code:
Sub Save()
Workbooks.Open "C:\Documents and Settings\tom.dance\Desktop\Sales Database.xlsm"
ThisWorkbook.Sheets("Sheet1").Range("A2:M2").Copy
Workbooks("Sales Database.xlsm").Sheets("Sales").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteValues
Workbooks("Sales Database.xlsm").Save
Workbooks("Sales Database.xlsm").Close
ThisWorkbook.Sheets("Sheet1").Range("C2:M2").ClearContents
End Sub

Awesome! Thank you very much, worked perfectly.

Cheers
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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