I have a bar Chart in PowerPoint and want to select the row (Category 1 - 4, see Screenshot 1) depending on my selection in the ComboBox. This is my Code so far:
Private Sub ComboBox1_Change()
With SlideShowWindows(1).View
Select Case ComboBox1.Value
Case "Category 1"
Case "Category 2"
Case Else
End Select
End With
End Sub
I have no idea how to select source data when there is no seperate Excel-Sheet. There is just the "Excel-Sheet" in PowerPoint which is generated when inserting the Diagramm.
Your chart is contained in a
Shape
object, and you can access the source data throughShape.Chart.ChartData.Workbook.Sheets(1)
, as this answer proposes.I understood by your question that you want the chart to only display the Category selected. You can hide the rows you don't want to be displayed in the source data, and they will be hidden in the chart.
This populates
ComboBox1
with Categories 1-4.And then you can hide the rows you don't want displayed with something like this.
Screenshot