J
John
I keep getting HasTitle of _Chart has failed error. Any ideas?
Sub MakeChart()
On Error Resume Next
Application.DisplayAlerts = False
Charts("Term Chart").Delete
On Error GoTo 0
Set NewChart = ThisWorkbook.Charts.Add
NewChart.Name = "Term Chart"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Terms"
If FirstRange > 1 Then
NewChart.SeriesCollection.Add Source:=FirstRange
End If
If SecondRange > 1 Then
NewChart.SeriesCollection.Add Source:=SecondRange
End If
If ThirdRange > 1 Then
NewChart.SeriesCollection.Add Source:=ThirdRange
End If
End With
End Sub
Sub MakeChart()
On Error Resume Next
Application.DisplayAlerts = False
Charts("Term Chart").Delete
On Error GoTo 0
Set NewChart = ThisWorkbook.Charts.Add
NewChart.Name = "Term Chart"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Terms"
If FirstRange > 1 Then
NewChart.SeriesCollection.Add Source:=FirstRange
End If
If SecondRange > 1 Then
NewChart.SeriesCollection.Add Source:=SecondRange
End If
If ThirdRange > 1 Then
NewChart.SeriesCollection.Add Source:=ThirdRange
End If
End With
End Sub