Results 1 to 16 of 16

Copy/Paste Clipboard in VBA

Threaded View

  1. #1
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Copy/Paste Clipboard in VBA

    The attached Workbook which contains a sheet with two pivot tables. I want to convert the pivot tables into normal tables, so the source data is no longer linked. I'm using this technique manually but want to convert it into a macro:
    1. Select the pivot table cells and press Ctrl+C to copy the range.
    2. Use Paste Special to Paste Values.
    3. Display the Office Clipboard.
    4. With the unlinked pivot selected, click the item on the Office Clipboard that corresponds to the pivot table copy operation. It will be the last item, unless you copied something else.

    I went through the steps and recorded the actions to give me this:

    Sub PasteClipboard()
    
        Range("B4:F9").Select
        Selection.Copy
        Range("B4").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
        Application.CutCopyMode = False
        ActiveSheet.Paste
    End Sub
    However if I then attempt to run the macro on my original pivot tables I get and error (highlighted in red in the code above). Is there anyway to resolve this?

    Many thanks
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Copy and paste text from clipboard
    By plans in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-26-2014, 09:23 PM
  2. [SOLVED] Copy Paste from another sheet w/o clipboard
    By tjw06d in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-28-2014, 10:39 AM
  3. Disable Copy and Paste from Clipboard Buttons
    By Durobell in forum Excel General
    Replies: 6
    Last Post: 08-09-2012, 08:09 AM
  4. Replies: 3
    Last Post: 04-13-2012, 12:26 PM
  5. Copy to Clipboard, concatenate, paste
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-18-2010, 05:15 PM
  6. Copy paste without clipboard
    By Slyone2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-11-2010, 03:52 AM
  7. [SOLVED] Copy to Clipboard and so that I may paste to any other program
    By tomwashere2 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-22-2006, 10:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1