mystery series in graph

Weil

New Member
Joined
Sep 14, 2009
Messages
15
Hi,


I'm making a graph based on variables from a user form. It works, except there is a mystery series, series 4 - which has no name, one value of {1}, and the same X values as the other series - and I have no idea what is making this happen.

Here is the code for the graph, does anyone know why this is happening?

Workbooks("Utilization Metric Data 091120.xls").Activate
ActiveWorkbook.Sheets("Rev_Hdct").Activate
Set RangeX = Range(Cells(2, intSeriesFC), Cells(2, intSeriesTC))
Set Range1 = Range(Cells(intSeriesYrReg1, intSeriesFC), Cells(intSeriesYrReg1, intSeriesTC))
Set Range2 = Range(Cells(intSeriesYrReg2, intSeriesFC), Cells(intSeriesYrReg2, intSeriesTC))
Set Range3 = Range(Cells(intSeriesYrReg3, intSeriesFC), Cells(intSeriesYrReg3, intSeriesTC))


Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).XValues = RangeX
ActiveChart.SeriesCollection(1).Values = Range1
ActiveChart.SeriesCollection(1).Name = "=""Central"""
ActiveChart.SeriesCollection(2).XValues = RangeX
ActiveChart.SeriesCollection(2).Values = Range2
ActiveChart.SeriesCollection(2).Name = "=""US_East"""
ActiveChart.SeriesCollection(3).XValues = RangeX
ActiveChart.SeriesCollection(3).Values = Range3
ActiveChart.SeriesCollection(3).Name = "=""US_West"""
ActiveChart.Location Where:=xlLocationAsNewSheet


With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Rev/Hdct"
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With
With ActiveChart.Axes(xlCategory)
.HasMajorGridlines = True
.HasMinorGridlines = False
End With
With ActiveChart.Axes(xlValue)
.HasMajorGridlines = True
.HasMinorGridlines = True
End With
ActiveChart.HasLegend = False
ActiveChart.HasDataTable = True
ActiveChart.DataTable.ShowLegendKey = True
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,214,832
Messages
6,121,843
Members
449,051
Latest member
excelquestion515

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