Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

vba - Paste vs PasteSpecial

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...