![]() |
#1
|
|||
|
|||
![]()
Hello,
I am preparing automization for data in excel and presentation. The last thing I struggle with is deleting unnecessary legend entries in power point. I suppose I would be able to get rid of them in excel via VBA, but still it doesn't change anything because even if I do so it will not affect power point presentation. Power Point Charts are linked to excel, and as I checked: deleting legend enteries in Excel file will not affect linked charts in PowerPoint (checked on Office 2010). What I would like to do is some macro which will check each slide, each chart. And if there is a blank data entry delete it's legend entry. Here is how I would like to change my graphs: Before After I think something like that will make it, however I do not know VBA for PowerPoint. Code:
Sub MacroDeletingLegendEnteries() Dim ppt As Presentation Dim s As Slide Dim ch As Chart 'Count from slide one to last slide For i=1 to ppt.Slides.Count 'Count from chart one to last chart on this slide For x=1 to <last chart on this slide> 'Take any action only if chart has legend - there are some charts which don't need it If <chart has a legend> Then 'Count from series 1 to last one For z=1 to <Number of data series on slide> 'If the legend entry does not exist, then delete it legend entry on chart If <Data series z = 0 (there isn't any data on graph)> Then <Delete Legend entry number z> End If Next z End if Next x Next i End Sub Thank you very much for any help with <> entries ![]() |
Tags |
powerpoint macro |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
can power point LINK to embedded object in power point ? | johnseito | PowerPoint | 0 | 05-24-2014 04:31 AM |
![]() |
Paincho | PowerPoint | 1 | 06-27-2011 08:07 AM |
Microsoft Power Point 2004 to Office Power Point 2007 | chuff | PowerPoint | 0 | 03-20-2011 01:23 PM |
Power Point on the Web | Carthalion | PowerPoint | 0 | 03-03-2010 09:59 AM |
power point | ladonna12 | PowerPoint | 2 | 02-16-2009 09:34 AM |