paste special code in 2010

crimiss
NewLounger
Posts: 3
Joined: 29 Nov 2011, 18:15

paste special code in 2010

Post by crimiss »

I've been trying to update my "paset as values" button that i created in excel 2003 to excel 2010. the section of code "selection.pastespecial Paste:=xlPasteValues...." doesn't work.
the way i've used this before was to copy an area within the spreadsheet i'm in and then highlight the cell location where i'd like to paste value (this could be in the same worksheet or a new one) and finally i'd run the macro which i had assigned to a button. now its totally broken. I've searched the internet for weeks now and i'm curious if anyone here has seen this problem before and has any viable answers. thanks in advance.

User avatar
StuartR
Administrator
Posts: 12608
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: paste special code in 2010

Post by StuartR »

I assume this is in Excel 2010. The line
Selection.PasteSpecial Paste:=xlPasteValues
works correctly for me. Can you show the exact code you are running and tell us what happens or what error message you get?
StuartR


User avatar
HansV
Administrator
Posts: 78492
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: paste special code in 2010

Post by HansV »

Welcome to Eileen's Lounge!

Your macro (and button) should still work correctly in Excel 2010. Perhaps you should create the macro anew, or assign it again to a button.

By the way, if you click the lower half of the Paste button on the left hand side of the Home tab of the ribbon, Values is one of the options offered.
You can also use the keyboard shortcut Alt+H, V, V.
And you can add a built-in Paste Values button to the Quick Access Toolbar:
- Select File > Options.
- Click Quick Access Toolbar.
- Select "Commands Not in the Ribbon" from the "Choose commands from" dropdown.
- Scroll down the list of commands and select "Paste Values".
- Click "Add >>" to add the button to the Quick Access Toolbar.
- Click OK.
x856.png
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

crimiss
NewLounger
Posts: 3
Joined: 29 Nov 2011, 18:15

Re: paste special code in 2010

Post by crimiss »

I actually tried rewriting the code and everything suggested. i'm aware of the option to paste values by right-clicking and have resorted to doing that. I guess i'll set the shortcut button as suggested by Hans. Given that they have that feature now means that my "button" is obsolete anyway :)

Thanks. it seems i was making a mountain out of a sandbox.

crimiss
NewLounger
Posts: 3
Joined: 29 Nov 2011, 18:15

Re: paste special code in 2010

Post by crimiss »

i decided to set it as a button on the quick access toolbar as this feature renders my "macro button" obsolete. i'm very greatful for the quick responses. thanks StuartR and Hans...

User avatar
HansV
Administrator
Posts: 78492
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: paste special code in 2010

Post by HansV »

You're welcome! Feel free to post more questions if you have them.
Best wishes,
Hans