Help with fixing procedure. (Should be easy)

andrew456

New Member
Joined
Nov 2, 2014
Messages
31
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?
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Andrew
Both series ARE actually there.
Note Series 98 is a flat line along the bottom of the graph !!
If you look at the data variation, Series 98 goes from 16k to 1.5m, whereas Series 99 goes from 22m to 94m. !!!!
 
Upvote 0
Okay but that's two (which strangely doesn't appear on my work computer). But the others aren't showing up. I can't figure out why.
 
Upvote 0
Your code only selects 2 series...and 2 show on the graph each time ???
I filtered for 5 users, and manually selected each one with the CTRL Key and they all appeared...given that some of the graphs are a flat line that simply look like the btotom border of the graph !!
 
Upvote 0

Forum statistics

Threads
1,214,950
Messages
6,122,438
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top