Pasting values rather than formulae in VBA.

adam.coles

New Member
Joined
Sep 14, 2006
Messages
3
Similar to Paste Special>Paste Values, I want to paste the cell value in a macro. The current portion of the macro is as follows:

Set sh3 = Worksheets("Sheet3")
Set dest = sh3.Range("A5").End(xlDown).Offset(1, 0)
sh3.Range("F4").Copy Destination:=dest

Cell "F4" is copied to the bottom of column A. However, it is copying the formula: =TODAY(). I would like this date to be pasted as the actual date i.e. so that it doesn't change.

Any help would be much appreciated.

Thanks
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Try

sh3.Range("F4").Copy
dest.PasteSpecial (xlValues)
 

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Why do you need to copy at all? Why not just assign the date value to the cell?

Code:
Sub test()
Dim sh3 As Worksheet
Set sh3 = Worksheets("Sheet3")
sh3.Range("A5").End(xlDown).Offset(1, 0) = Date
End Sub
 

Forum statistics

Threads
1,176,227
Messages
5,902,029
Members
434,934
Latest member
brendalpzm

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
Top