Sub 2DGraphTry()
Dim chartObj As ChartObject
Set chartObj = ThisWorkbook.Sheets("Sheet1").ChartObjects.Add(Left:=100, Width:=375, Top:=75, Height:=225)
chartObj.Chart.ChartType = xlLine
chartObj.Chart.SetSourceData Source:= ThisWorkbook.Sheets("Sheet1").Range("A:D")
With chartObj.Chart.Axes(xlValue, xlSecondary)
.HasTitle = True
.AxisTitle.Text = "Secondary Axis Title" ' Customize the title as needed
End With
End Sub
Modify as needed
Also just record if you need a macro and perform steps so that macro is auto created and can modify on top