Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paste vs PasteSpecial

Tags:

excel

vba

After two hours of futile search and frustration. I am posting the question here.

Can anyone please explain the detailed difference between paste and pastespecial option in excel vba?

Or cite some resources which can help

like image 490
Rohit Saluja Avatar asked Apr 23 '16 12:04

Rohit Saluja


1 Answers

That's simple :


Paste will paste exactly what's in the origin range (to make it simple: values or formulas)


PasteSpecial let you define what you want to paste (value, formula, style, etc..).

With:

expression .PasteSpecial(Paste, Operation, SkipBlanks, Transpose)

The first argument Paste is of XlPasteType Enumeration type that determines what you can choose


Some further read:

MSDN Range.PasteSpecial Method

The PasteSpecial VBA Command: Get VBA to Do the Hard Work for You

like image 71
Thomas G Avatar answered Sep 28 '22 08:09

Thomas G