+ Reply to Thread
Results 1 to 5 of 5

Excel VBA pivot table copy and pasting hangs Excel

  1. #1
    Registered User
    Join Date
    12-15-2014
    Location
    Wales, UK
    MS-Off Ver
    365
    Posts
    66

    Excel VBA pivot table copy and pasting hangs Excel

    Good day,

    I create a pivot table and then simply want to copy and paste it over itself, other times it works perfectly fine but on this one it hangs Excel and I can't exit without forcing Excel to close in Task manager. I'v located the code that hangs by running through it step by step. It's highlighted in RED, the part that actually has to copy and paste. Below is the whole code:

    Please Login or Register  to view this content.
    Last edited by Simone Fick; 08-18-2017 at 05:15 PM. Reason: Solved

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Excel VBA pivot table copy and pasting hangs Excel

    Hi,

    Perhaps use TableRange1 rather than TableRange2?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Excel VBA pivot table copy and pasting hangs Excel

    I do what you are doing all the time without a problem.
    I assume that your pivot table exists and that it is being referred to by the correct name.
    The code that is doing the copying and pasting looks fine, but try swapping it out with my minor variation
    I have added a message box to provide you with the range address - it will probably tell you nothing - but worth a try
    The "real" problem may lurk somewhere further up the code...

    Swap:
    Please Login or Register  to view this content.
    With:
    Please Login or Register  to view this content.
    Last edited by kev_; 08-18-2017 at 07:39 AM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  4. #4
    Registered User
    Join Date
    12-15-2014
    Location
    Wales, UK
    MS-Off Ver
    365
    Posts
    66

    Re: Excel VBA pivot table copy and pasting hangs Excel

    Hi Kev, I've tried swapping the code but it still hangs at the same spot even if I run through it step by step. Thanks anyway. I'm not sure how to fix it.

  5. #5
    Registered User
    Join Date
    12-15-2014
    Location
    Wales, UK
    MS-Off Ver
    365
    Posts
    66

    Re: Excel VBA pivot table copy and pasting hangs Excel

    I changed it to TableRange1 and it worked. Any idea why?
    But thank you very much!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 10-10-2014, 12:44 PM
  2. [SOLVED] Excel hangs when i do a copy.
    By Biruma in forum Excel General
    Replies: 0
    Last Post: 07-31-2006, 04:20 AM
  3. Excel hangs when pasting HTML from Internet Explorer
    By BigFurryMonster in forum Excel General
    Replies: 3
    Last Post: 06-27-2006, 03:47 PM
  4. [SOLVED] excel hangs when pasting into field?
    By geek-y-guy in forum Excel General
    Replies: 1
    Last Post: 05-16-2006, 06:58 PM
  5. excel hangs when pasting into field?
    By geek-y-guy in forum Excel General
    Replies: 0
    Last Post: 05-16-2006, 05:05 PM
  6. EXCEL hangs on PIVOT table!!
    By scardy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-18-2006, 09:46 AM
  7. excel hangs when copy 'n' pasting
    By I Believe in forum Excel General
    Replies: 0
    Last Post: 05-20-2005, 07:06 AM

Tags for this Thread

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