title: How to adapt excel VBA code to PPT VBA?
body: <p>What I want to do is to make VBA code which will hide and show individual series on a chart. I know how to write a VBA code in Excel, but do not know to rewrite the same code in PPT VBA. </p>
  
  <p>I have this code in Excel VBA:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>How can I write the same code in PowerPoint VBA?
  I tried to find solution in similar posts, but every post considers specific code which is hard for me to adapt to my code as I am new in VBA.</p>