Can someone please help me fix my procedure? I cannot debug because the debugger sees nothing wrong.
Sub UpdateChart2()
*
Dim oChtObj As ChartObject
*
Dim oSeries As Series
*
Dim tSeries As Series
*
Dim UserRow As Long
*
Dim AnotherRow As Long
*
*
Set oChtObj = ActiveSheet.ChartObjects(1)
*
On Error Resume Next
*
UserRow = ActiveCell.Row
*
AnotherRow = ActiveCell.Row
*
*
If UserRow < 4 Or IsEmpty(Cells(UserRow, 1)) Then
*
oChtObj.Visible = False
*
*
Else
*
With oChtObj
With .Chart
If .SeriesCollection.Count = 0 Then
Set oSeries = .SeriesCollection.NewSeries
Set tSeries = .SeriesCollection.NewSeries
*
*
Else
*
Set oSeries = .SeriesCollection(1)
Set tSeries = .SeriesCollection(2)
*
End If
*
tSeries.Values = Range(Cells(AnotherRow, 20), Cells(AnotherRow, 31))
oSeries.Values = Range(Cells(UserRow, 2), Cells(UserRow, 13))
.HasTitle = True
.ChartTitle.Text = Cells(UserRow, 1).Text
.ChartType = xlLine
*
*
End With
*
.Visible = True
*
*
End With
*
End If
*
*
*
*
*
oSeries.XValues = Worksheets("Sheet1").Range("B17:M17")
*
oSeries.Border.Weight = xlThick
oSeries.Border.LineStyle = xlContinuous
oSeries.Smooth = True
tSeries.XValues = Worksheets("Sheet1").Range("T17:AE17")
tSeries.Border.Weight = xlThick
tSeries.Border.LineStyle = xlContinuous
tSeries.Smooth = True
*
*
*
*
*
*
*
oChtObj.Visible = True
*
*
*
End Sub
*
*
The second line/series isn't showing and I do not know why. Can someone help?
Sub UpdateChart2()
*
Dim oChtObj As ChartObject
*
Dim oSeries As Series
*
Dim tSeries As Series
*
Dim UserRow As Long
*
Dim AnotherRow As Long
*
*
Set oChtObj = ActiveSheet.ChartObjects(1)
*
On Error Resume Next
*
UserRow = ActiveCell.Row
*
AnotherRow = ActiveCell.Row
*
*
If UserRow < 4 Or IsEmpty(Cells(UserRow, 1)) Then
*
oChtObj.Visible = False
*
*
Else
*
With oChtObj
With .Chart
If .SeriesCollection.Count = 0 Then
Set oSeries = .SeriesCollection.NewSeries
Set tSeries = .SeriesCollection.NewSeries
*
*
Else
*
Set oSeries = .SeriesCollection(1)
Set tSeries = .SeriesCollection(2)
*
End If
*
tSeries.Values = Range(Cells(AnotherRow, 20), Cells(AnotherRow, 31))
oSeries.Values = Range(Cells(UserRow, 2), Cells(UserRow, 13))
.HasTitle = True
.ChartTitle.Text = Cells(UserRow, 1).Text
.ChartType = xlLine
*
*
End With
*
.Visible = True
*
*
End With
*
End If
*
*
*
*
*
oSeries.XValues = Worksheets("Sheet1").Range("B17:M17")
*
oSeries.Border.Weight = xlThick
oSeries.Border.LineStyle = xlContinuous
oSeries.Smooth = True
tSeries.XValues = Worksheets("Sheet1").Range("T17:AE17")
tSeries.Border.Weight = xlThick
tSeries.Border.LineStyle = xlContinuous
tSeries.Smooth = True
*
*
*
*
*
*
*
oChtObj.Visible = True
*
*
*
End Sub
*
*
The second line/series isn't showing and I do not know why. Can someone help?