+ Reply to Thread
Results 1 to 11 of 11

Run Time Error - 1004 / Pivot Tables

  1. #1
    Registered User
    Join Date
    02-14-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2003
    Posts
    22

    Run Time Error - 1004 / Pivot Tables

    HI All

    I have created a Macro for Pivot Tables and when am trying to apply the same code in different sheet its showing the run time error 1004.

    Can someone please check the below code and let me know if any changes to be made also if possible can someone make changes to it.

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Run Time Error - 1004 / Pivot Tables

    Which line is highlighted in yellow when you get the error?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    02-14-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Run Time Error - 1004 / Pivot Tables

    It is getting stuck at below,


    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    02-14-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Run Time Error - 1004 / Pivot Tables

    Hi All,

    Can someone help me for the above please.

    Thanks & Regards,
    Srikanth

  5. #5
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Re: Run Time Error - 1004 / Pivot Tables

    The problem with this sort of code is always related to the setting of the source data range or the location of the new pivot table.

    http://support.microsoft.com/kb/940166/en-us

    Maybe try emptying TableDestination, as in TableDestination = "" instead of what you have now.

    I have one that works which I made a while ago, it goes like this:

    Please Login or Register  to view this content.
    Last edited by Pichingualas; 04-23-2012 at 09:03 AM.
    .?*??)
    `?.???.?*??)?.?*?)
    (?.?? (?.?
    Pichingualas <---
    ??????????????????????????

    Wrap your code with CODE TAGS.
    Thank those who helped you, Don't forget to add to their REPUTATION!!! (click on the star below their post).
    Please mark your threads as [SOLVED] when they are (Thread Tools->Mark thread as Solved).

  6. #6
    Registered User
    Join Date
    02-14-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Run Time Error - 1004 / Pivot Tables

    Hi ,

    Thanks for the information.

    Am very new to VBA, could you please help me by editing my code and past it again so that i can use it.

    Thanks,
    Ben

  7. #7
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Re: Run Time Error - 1004 / Pivot Tables

    Try with this:

    Please Login or Register  to view this content.
    If this still doesn't work, please check your data: make sure the first row of it (the headers) doesn't have any empty fields, which can also be a reason for your code crashing. Anyway, I hope it helps.
    Last edited by Pichingualas; 04-23-2012 at 12:05 PM. Reason: minor change in code

  8. #8
    Registered User
    Join Date
    02-14-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Run Time Error - 1004 / Pivot Tables

    Hi,

    Thanks for the above Code, I did check the "Header" and it does not have any "Empty" header or field, however the macro stopping at

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    02-14-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Run Time Error - 1004 / Pivot Tables

    Hi,

    Could you please help me for the above.

    Regards,
    Srikanth

  10. #10
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Re: Run Time Error - 1004 / Pivot Tables

    I'll look in to it, sorry for the delay.

  11. #11
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Re: Run Time Error - 1004 / Pivot Tables

    Sorry Srikanth, it works fine on this computer with excel 2007. I'll try on excel 2003 later on, don't have it at hand at the moment.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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