Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default 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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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.





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default 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.






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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 :-)



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick question - quick answer about assigning shortcut keys funkymonkUK[_75_] Excel Programming 1 October 13th 05 10:50 AM
pastespecial question Gary Keramidas Excel Programming 6 October 11th 05 12:31 AM
pastespecial question Paul Excel Programming 5 May 19th 05 01:07 PM
Quick question DB100[_15_] Excel Programming 1 October 11th 04 03:06 PM
pastespecial on a worksheet question mike Excel Programming 1 February 11th 04 08:03 PM


All times are GMT +1. The time now is 11:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"