ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   .Copy Destination:= << Forget when PasteValues is desired (https://www.excelbanter.com/excel-discussion-misc-queries/153910-copy-destination-%3D-forget-when-pastevalues-desired.html)

Jim May

.Copy Destination:= << Forget when PasteValues is desired
 
I'd like to establish a rule that doesn't seem to be spelled-out
as such after reveiwing some 50-60 Google.excel programming threads.

..Copy Destination:= works fine when you need to copy a range (that
might include formulas) to another range and retain the formulas
(relative-addressing applied) in the destination range.

..Copy Destination:= doesn't mix and should not be considered if you are
at all interested in pasteing values. It just doesn't apply (one must use
the .PasteSpecial (property) with the augumnet Paste(xlValues) instead..

Can someone confirm this?

TIA,

Jim May

David Hilberg

.Copy Destination:= << Forget when PasteValues is desired
 
That is my experience.

IOW, this is invalid:
* [a1].Copy Destination:=[a2], Paste:=xlPasteValues

This works, but leaves a running border around the copy range:
[a1].Copy: [a2].PasteSpecial Paste:=xlPasteValues

(The lower example uses a colon as separator to puts two statements on
the same line.)

- David

On Aug 12, 1:46 pm, Jim May wrote:
I'd like to establish a rule that doesn't seem to be spelled-out
as such after reveiwing some 50-60 Google.excel programming threads.

.Copy Destination:= works fine when you need to copy a range (that
might include formulas) to another range and retain the formulas
(relative-addressing applied) in the destination range.

.Copy Destination:= doesn't mix and should not be considered if you are
at all interested in pasteing values. It just doesn't apply (one must use
the .PasteSpecial (property) with the augumnet Paste(xlValues) instead..

Can someone confirm this?

TIA,

Jim May





All times are GMT +1. The time now is 03:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com