Paste values

  • Thread starter Thread starter squirmy
  • Start date Start date
S

squirmy

Hello. Please help.

I am trying, in a single VBA code line if possible, to
copy the entire sheet and "paste special - values" right
over the top of the existing data.

My code follows, but I get an error even though it seems
to me it should work. Can someone correct my code or
please supply me with a functional equivalent?

Cells.Copy Destination:=Range("A1").PasteSpecial _
(Paste:=xlPasteValues)

Thanks much in advance for your example code and
assistance.
 
The code:
Cells.Copy Range("A1")
with a space after Copy says to copy the sheet and paste it to A1.
If you want to paste values only you need two lines:
Cells.Copy
[A1].PasteSpecial xlPasteValues
Application.CutCopyMode = False

The 3rd line clears the clipboard.
HTH Otto
 
Back
Top