【发布时间】:2017-06-26 19:02:27
【问题描述】:
我想做的是制作 VBA 代码,它将在图表上隐藏和显示各个系列。我知道如何在 Excel 中编写 VBA 代码,但不知道如何在 PPT VBA 中重写相同的代码。
我在 Excel VBA 中有这段代码:
Sub FirstSer()
Dim cht As Chart
Dim ser As Series
'Retrieve our chart and seriescollection objects'
Set cht = Worksheets("Sheet1").ChartObjects("Chart 1").Chart
Set ser = cht.SeriesCollection(1)
'Set the first series line to be hidden'
With ser.Format.Line
If .Visible = msoTrue Then
.Visible = msoFalse
ser.Name = vbNullString
Else
.Visible = msoTrue
ser.Name = "First"
End If
End With
End Sub
如何在 PowerPoint VBA 中编写相同的代码? 我试图在类似的帖子中找到解决方案,但是每个帖子都考虑了特定的代码,因为我是 VBA 新手,所以我很难适应我的代码。
【问题讨论】:
标签: vba excel powerpoint