Data not showing up in charts

guiltyberto

New Member
Joined
Jul 22, 2014
Messages
23
Hi,

I am having a weird problem, I am trying to graph these data ranges, but they simply are not appearing in the charts. I am almost 100% positive that I am correctly retrieving the range, but they still aren't showing up! Any help would be greatly appreciated

Chart creation

Code:
Dim newChart As Chart
Dim accName As String
    
Set newChart = accWS.ChartObjects.Add(currL, currT, W, H).Chart    'just adding the chart to worksheet accWS
accName = "" & accSumWS.Range("C" & i).Value

With newChart
    .ChartType = xlColumnClustered
    .SeriesCollection.NewSeries
    .SeriesCollection(1).name = accName
    .Legend.Delete                                                   'i is simply a long determined previously
    .SeriesCollection(1).Values = getMonthValues(accSumWS, i)        'DOESNT WORK...do not know why
    .SeriesCollection(1).XValues = getMonthValues(accSumWS, monthRowOffset)        'Represents names of months (monthRowOffset is a const)
    .HasTitle = True
    .ChartTitle.Text = accName
End With

And here is the function mentioned
Code:
Private Function getMonthValues(ws As Worksheet, row As Long) As Range
   Set getMonthValues = ws.Cells(row, monthColOffset).Range("A1:C1,E1:G1,I1:K1,M1:O1")
End Function

I am like 99.9% sure the getMonthValues function works like I want it to (I have done a lot of testing and use it elsewhere in my program). I just do not understand why it is not working in this instance

Thanks in advance!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
If you select the series on the chart do you see a SERIES formula in the formula bar? What are monthColOffset and monthRowOffset?
 
Upvote 0
If you select the series on the chart do you see a SERIES formula in the formula bar? What are monthColOffset and monthRowOffset?

What do you mean see a SERIES formula? How do I check exactly?

monthColOffset and monthRowOffset are just constants determined earlier

Thanks for the quick response!
 
Upvote 0
What is the SERIES formula? Copy it and paste it into a reply. And what are monthColOffset and monthRowOffset.
 
Upvote 0

Forum statistics

Threads
1,214,622
Messages
6,120,580
Members
448,972
Latest member
Shantanu2024

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