Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Quick question - quick answer about assigning shortcut keys | Excel Programming | |||
pastespecial question | Excel Programming | |||
pastespecial question | Excel Programming | |||
Quick question | Excel Programming | |||
pastespecial on a worksheet question | Excel Programming |