Cells (). Insert VS cells .pastespecial?

How the code below works:

.Range("D4:F4").copy .cells(1,1).PasteSpecial 

While below does not work:

 .Range("D4:F4").copy .cells(1,1).Paste 

I understand the correct syntax

 .Range("D4:F4").copy Destination:= 
+4
source share
1 answer

The answer is very simple. .Paste not a property of a Cells object, but a Worksheet Object

If you type . after Cells , Intellisense will confirm this fact :)

There are various ways to copy data through.

If you want to copy only values, not formatting, then this is the best way

 rng1.Value = rng2.Value 

If you want to transfer formatting, or you can use

 Rng1.copy Rng2 

or

 Rng1.Copy rng2.pastespecial 
+4
source

All Articles