@Chris Neilsen provided the most practical and elegant solution to the problem (his code snippet follows):
Sheets("XYZ").Range("A2") = Sheets("XYZ").Range("A1").Value
In order to investigate and understand the possible cause of this strange behavior (maybe an error) of the Range object, I posted a couple of comments, which are given below:
There is a conceptual difference between the original expression (see below):
Sheets("XYZ").Range("A2") = Sheets("XYZ").Range("A1")
and the solution suggested by @ Chris Neilsen , namely: the original expression implicitly assigns a Range var object (essentially a pointer) to another Range object, as shown in the following code fragment with an explicit purpose
Set rng = Sheets("XYZ").Range("A1") Sheets("XYZ").Range("A2") = rng
while the proposed solution explicitly passes the value property. However, the reason the assignment of the Range object did not work for the value with the string. String lengths> 8202 are currently unclear (this may be caused by some internal nuances of the implementation of the Excel range object).
Thank you very much for posting this interesting question and fruitful discussion. Yours faithfully,
source share