+ Reply to Thread
Results 1 to 3 of 3

Attempting to change source data in Excel of a chart in PowerPoint

  1. #1
    Registered User
    Join Date
    04-17-2013
    Location
    St. Louis
    MS-Off Ver
    Excel 2010
    Posts
    36

    Attempting to change source data in Excel of a chart in PowerPoint

    Hi y'all. I'm trying to manipulate a chart in PowerPoint that has source data in Excel. To start off, the chart is a simple Hi-Low-Close stock chart that has six categories along the X axis. What I want to do is be able to edit the chart to give it an additional five categories along the X axis for a total of 11. Here's the relevant part of the code I've got now. The chart named "Chart7" on slide 2 of the PowerPoint presentation is the one I want to change. What I want to do is be able to press a button in PowerPoint named "1" and the chart will add in 5 more categories (This Quarter 1, This Half Year 1, etc) along the X axis. It's okay that they'd have no values right now.

    I know there's some redundancy with the first six lines of the ChartManip sub, but if I don't have that there, nothing changes when I press the button. When I do have it there like shown in the code below, nothing happens the first time I press it. The second time I press it though, it edits the data in Excel, but it only makes the chart data H36:K45 instead of H36:K46 like it says it should, so I think that's the line that's not working. I'll mark that in the code in red. I think the reason that it's only going through K45 is because the way I'm adding in the new categories in the X axis, I want them in between the ones that already exist. So it's automatically adjusting the source data already except that it's not capturing the new "Three Years 1" category I'm adding at the very end. The part with all the cutting is just adjusting the cells in Excel, so I don't think there should be a problem there. Eventually, I'll put in a shape named "2" that you can press to undo the new X axis categories, but I think I can figure that out once I know how to put them there in the first place. Any help would be greatly appreciated!

    Please Login or Register  to view this content.
    Edit: I think the line in red is doing something actually, but no matter what, it never goes past H36:K45.
    Last edited by DPWM; 07-06-2013 at 10:12 PM.

  2. #2
    Registered User
    Join Date
    04-17-2013
    Location
    St. Louis
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Attempting to change source data in Excel of a chart in PowerPoint

    I've narrowed down the problem, so hopefully this will help. If you don't include the red line, nothing happens. If you do include the red line, the chart in PowerPoint will ALWAYS set the source data range to H36:K45. I have no idea why. I've tried H36:K44, H36:K46, and K36:K47 and it always sets it to H36:K45. At first I thought it might have something to do with it only wanting to show 10 categories, but if I manually go in and change the source data, I can fit all 11 in there. Still scratching my head on this one.

  3. #3
    Registered User
    Join Date
    04-17-2013
    Location
    St. Louis
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Attempting to change source data in Excel of a chart in PowerPoint

    For any lost soul who happens to come across this exact problem by googling it, here's what I did. I just added in the new categories I wanted where I would want them to appear, hid them, and then put in some code so that if I click one of the buttons it will either unhide or hide the rows that the data is in.

+ 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