+ Reply to Thread
Results 1 to 5 of 5

Pivot Table & Chart with Excel VBA - issue on mAcro

  1. #1
    Registered User
    Join Date
    12-05-2013
    Location
    Newyork
    MS-Off Ver
    Excel 2013
    Posts
    6

    Pivot Table & Chart with Excel VBA - issue on mAcro

    Hi,

    I have the following requirement where I need to create the pivot table.

    The issue is when I press execute button the macro completed successfully, but the Rows in the table do not have any values. But if I execute step by step in edit mode, I'm getting the required output. I don't know what i'm missing why I face this issue

    The input and the code in the attachment with it

    Please Login or Register  to view this content.


    Thanks
    Guna
    Attached Files Attached Files
    Last edited by bsguna; 07-14-2016 at 05:36 AM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Pivot Table & Chart with Excel VBA - issue on mAcro

    Unfirtunately your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

    However why are you bothering to delete and then recreate your pivot tables each time you get new data. Just create a dynamic range name for your data and use that in the PTs definitions.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    12-05-2013
    Location
    Newyork
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: Pivot Table & Chart with Excel VBA - issue on mAcro

    I made the changes to the code. Please let me know if i need to make any further changes

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Pivot Table & Chart with Excel VBA - issue on mAcro

    Quote Originally Posted by bsguna View Post
    I made the changes to the code. Please let me know if i need to make any further changes
    Thank you - that's fine.

    Now just create dynamic range names and avoid the macro altogether, save perhaps for a single line of code in any macro that loads new data, or failing that the Sheet Activate event of the sheets that contain PTs. The single line of code would be

    Please Login or Register  to view this content.

  5. #5
    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: Pivot Table & Chart with Excel VBA - issue on mAcro

    Hi Guna,

    You are missing an important line at the end.

    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

+ 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. [SOLVED] calculating specific data from a pivot table to create a pivot chart in Excel 2016
    By cinstanl in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-15-2016, 12:14 PM
  2. Excel for Mac Pivot Table Formatting Issue
    By semantics in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-28-2013, 02:34 PM
  3. Basic Question - Pivot Table Div/0 issue - Excel 2010
    By Christianb in forum Excel General
    Replies: 3
    Last Post: 04-30-2012, 01:42 PM
  4. Macro to create pivot table/pivot chart
    By Karina in forum Excel General
    Replies: 2
    Last Post: 10-27-2011, 10:33 PM
  5. Excel 2007 Pivot Chart Issue
    By ewanioc in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-22-2011, 09:36 AM
  6. [SOLVED] Pivot Table issue in Excel 2007
    By ExcelInstructor in forum Excel General
    Replies: 1
    Last Post: 06-29-2006, 03:50 PM
  7. [SOLVED] Pivot Table Memory Issue - Excel crashes
    By rmsterling in forum Excel General
    Replies: 0
    Last Post: 11-11-2005, 06:10 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