+ Reply to Thread
Results 1 to 5 of 5

Help with Pie Chart Macro

  1. #1
    Registered User
    Join Date
    05-15-2014
    MS-Off Ver
    Excel 2010
    Posts
    3

    Help with Pie Chart Macro

    Hello, I am working on a macro that creates a pie chart based on some data and then changes the 3d rotation of the pie chart. The problem is when I run the macro it will not work because part of the code refers to the chart as Chart 1 but every time the the macro makes a new chart it gets a new number added on the end such as Chart 1, Chart 2 etc. Is there some way that each chart created will have the same name? I tried re recording the macro and naming the chart in Excel but that still did not work. Here is my code:
    Please Login or Register  to view this content.
    Any suggestions to fix this problem are welcome. Thanks.

  2. #2
    Valued Forum Contributor
    Join Date
    09-01-2013
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2010
    Posts
    324

    Re: Help with Pie Chart Macro

    Near the top of your code try changing this:


    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    which is what the rest of your code is referring to.


    Shelton A.
    If Helpful, Add Reputaion!

  3. #3
    Valued Forum Contributor
    Join Date
    09-01-2013
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2010
    Posts
    324

    Re: Help with Pie Chart Macro

    Sorry. Try renaming the active chart


    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-15-2014
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Help with Pie Chart Macro

    Quote Originally Posted by playaller View Post
    Sorry. Try renaming the active chart
    Hi, sorry for the long reply. I tried what you suggested and when I run the macro I get the run-time error that says the specified value is out of range. Here is a screenshot of the debug screen.vba error.jpg

  5. #5
    Registered User
    Join Date
    05-15-2014
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Help with Pie Chart Macro

    Just updating my previous post, I have managed to get the chart to insert correctly with no errors and have it look the way I want as well. I changed my code to this using the above help from playaller;

    Please Login or Register  to view this content.
    Thank you for posting that code change for me playaller.

+ 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] excel 2007 chart macro graphs data only from sheet on which macro was recorded
    By JW1028 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-19-2013, 06:33 PM
  2. Invalid Parameter Macro in Chart making Macro
    By rodrignj in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-06-2013, 03:47 PM
  3. Macro Search and Macro Pie Chart Generation
    By steverokh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-19-2012, 06:52 PM
  4. Chart Macro
    By Dgreiner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-11-2012, 07:09 PM
  5. Replies: 1
    Last Post: 06-09-2011, 03:44 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