ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Quick Question - PasteSpecial (https://www.excelbanter.com/excel-programming/383102-quick-question-pastespecial.html)

mr tom

Quick Question - PasteSpecial
 
Current Code:

ActiveSheet.PasteSpecial Format:=3

This is somebody else's code.

Just a quick question about the Format:=3

Does it PasteSpecial as Values? Or does it do something else?

Cheers,

Tom.

mr tom

Quick Question - PasteSpecial
 
Interesting.

Experimentally, it seems it must be paste special values. It certainly
doesn't perform the subtract function.

Goodness knows how we're supposed to know that!

Thanks so much for your help.

Tom.

"Jim Rech" wrote:

If you have Excel open the VBE. Then open the Object Browser (press F2).
In the Classes control on the left scroll down to XlPasteType. In the
Members pane you'll see all the enumerations. As you select each one its
number value appears in the bottom of the Object Browser. I don't see any
that are '3'.

--
Jim
"mr tom" <mr-tom at mr-tom.co.uk.(donotspam) wrote in message
...
| Current Code:
|
| ActiveSheet.PasteSpecial Format:=3
|
| This is somebody else's code.
|
| Just a quick question about the Format:=3
|
| Does it PasteSpecial as Values? Or does it do something else?
|
| Cheers,
|
| Tom.




Tom Ogilvy

Quick Question - PasteSpecial
 
expression.PasteSpecial(Paste, Operation, SkipBlanks, Transpose)

the xlPasteSpecialSubtract would be an argument to the Operation


expression.PasteSpecial(Paste, Operation:=xlPasteSpecialSubtract,
SkipBlanks, Transpose)

As I said, that is for the range version of paste special. The example you
showed is not for a range.

--
Regards,
Tom Ogilvy


"mr tom" <mr-tom at mr-tom.co.uk.(donotspam) wrote in message
...
Interesting.

Experimentally, it seems it must be paste special values. It certainly
doesn't perform the subtract function.

Goodness knows how we're supposed to know that!

Thanks so much for your help.

Tom.

"Jim Rech" wrote:

If you have Excel open the VBE. Then open the Object Browser (press F2).
In the Classes control on the left scroll down to XlPasteType. In the
Members pane you'll see all the enumerations. As you select each one its
number value appears in the bottom of the Object Browser. I don't see
any
that are '3'.

--
Jim
"mr tom" <mr-tom at mr-tom.co.uk.(donotspam) wrote in message
...
| Current Code:
|
| ActiveSheet.PasteSpecial Format:=3
|
| This is somebody else's code.
|
| Just a quick question about the Format:=3
|
| Does it PasteSpecial as Values? Or does it do something else?
|
| Cheers,
|
| Tom.






mr tom

Quick Question - PasteSpecial
 
Sorry - you've completely lost me, but I really do appreciate you taking the
time to reply :-)

Tom.

"Tom Ogilvy" wrote:

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

the xlPasteSpecialSubtract would be an argument to the Operation


expression.PasteSpecial(Paste, Operation:=xlPasteSpecialSubtract,
SkipBlanks, Transpose)

As I said, that is for the range version of paste special. The example you
showed is not for a range.

--
Regards,
Tom Ogilvy


"mr tom" <mr-tom at mr-tom.co.uk.(donotspam) wrote in message
...
Interesting.

Experimentally, it seems it must be paste special values. It certainly
doesn't perform the subtract function.

Goodness knows how we're supposed to know that!

Thanks so much for your help.

Tom.

"Jim Rech" wrote:

If you have Excel open the VBE. Then open the Object Browser (press F2).
In the Classes control on the left scroll down to XlPasteType. In the
Members pane you'll see all the enumerations. As you select each one its
number value appears in the bottom of the Object Browser. I don't see
any
that are '3'.

--
Jim
"mr tom" <mr-tom at mr-tom.co.uk.(donotspam) wrote in message
...
| Current Code:
|
| ActiveSheet.PasteSpecial Format:=3
|
| This is somebody else's code.
|
| Just a quick question about the Format:=3
|
| Does it PasteSpecial as Values? Or does it do something else?
|
| Cheers,
|
| Tom.







JE McGimpsey

Quick Question - PasteSpecial
 
There are two different PasteSpecial methods.

The one in the code you cite is the Worksheet method, which takes the
format parameter, which VBA Help defines as

Optional Variant. A string that specifies the Clipboard format of the
data.

Based on a minimum of experimentation, the format of the data that is
pasted in when a cell with a formula is copied and Format:=3 is used,
the result is that the displayed value is pasted. Format:=1 also pastes
the result, while Format:=2 pastes the formula.

It has nothing to do with xlPasteType, which is associated with the
Range version of PasteSpecial (specifically, the Paste argument).

Your speculation about Paste Special Values isn't warranted - that only
applies to the Range version.

Your speculation about the Subtract function isn't warranted either,
that also only applies to the Range version, and depends on the
Operation argument.

In article ,
mr tom <mr-tom at mr-tom.co.uk.(donotspam) wrote:

Sorry - you've completely lost me, but I really do appreciate you taking the
time to reply :-)


NickHK

Quick Question - PasteSpecial
 
Tom,
Whilst VBA only gives access to the text format of the clipboard directly,
other formats can also be present. Using the VB5/6 Clipboard, you can access
the other formats, some of which a

?vbCFLink
-16640
?vbCFText
1
?vbCFBitmap
2
?vbCFMetafile
3
?vbCFDIB
8
?vbCFPalette
9
?vbCFRTF
-16639
?vbCFFiles
15

Assuming the numbers are consistent, your code is trying to paste the
clipboard data as a metafile.

Playing around with the macro recorder, seems that you can also:
ActiveSheet.PasteSpecial Format:="Picture (Enhanced Metafile)"

NickHK

"mr tom" <mr-tom at mr-tom.co.uk.(donotspam) wrote in message
...
Current Code:

ActiveSheet.PasteSpecial Format:=3

This is somebody else's code.

Just a quick question about the Format:=3

Does it PasteSpecial as Values? Or does it do something else?

Cheers,

Tom.





All times are GMT +1. The time now is 07:09 AM.

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