kylegjordan
Technical User
When a range object is created and it refers to cells on a worksheet, can it be used as the values for a data series in a chart that is its own separate sheet?
Below is a section of a sub I'm trying to debug. The purpose is to add a new data series to the chart entitled "Consolidated" using a range of cells from a worksheet called "Weekly Tracker". Any help or suggested alternate routes would be great. Thanks. kj
Private Sub trialstuff()
Dim col(1 To 3) As Integer
Dim salesrow(1 To 2) As Integer
Dim datarange As Range, vari As Range, fari As Range
salesrow(2) = 37
col(3) = 47
j = 2
k = 3
Set vari = Worksheets("Weekly Tracker".Cells(salesrow(j), col(k))
Set fari = Worksheets("Weekly Tracker".Range("GA45:GD45"
Set datarange = Union(fari, vari)
Charts("Consolidated".SeriesCollection.NewSeries
Charts("Consolidated".SeriesCollection(k).Values = datarange
End Sub
Below is a section of a sub I'm trying to debug. The purpose is to add a new data series to the chart entitled "Consolidated" using a range of cells from a worksheet called "Weekly Tracker". Any help or suggested alternate routes would be great. Thanks. kj
Private Sub trialstuff()
Dim col(1 To 3) As Integer
Dim salesrow(1 To 2) As Integer
Dim datarange As Range, vari As Range, fari As Range
salesrow(2) = 37
col(3) = 47
j = 2
k = 3
Set vari = Worksheets("Weekly Tracker".Cells(salesrow(j), col(k))
Set fari = Worksheets("Weekly Tracker".Range("GA45:GD45"
Set datarange = Union(fari, vari)
Charts("Consolidated".SeriesCollection.NewSeries
Charts("Consolidated".SeriesCollection(k).Values = datarange
End Sub