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

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
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
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,875
Members
452,363
Latest member
merico17

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