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
And here is the function mentioned
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!
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!