Hold on, now what if i want to pull this data from a different worksheet? I thought I had that down but I guess not....I've attached another example workbook highlighting this problem (its slightly different than the one before). The code is also below.
Sub DynamicCostChartSample()
Select Case Range("C24")
Case Is = 1
'This is to pull multiseries line chart from the Financial Assessment Raw Data Page
ActiveSheet.Shapes("Chart 2").Select
ActiveChart.SetSourceData Source:=Range("'Financial Assessment Raw Data 1'J172:BD192")
ActiveSheet.Shapes("Chart 2").Chart.SeriesCollection(1).XValues = Range("'Financial Assessment Raw Data 1'K172:BD172")
'This is to pull individual series from the Financial Assessment Raw Data Page based upon the combo box
Case Else
ActiveSheet.Shapes("Chart 2").Select
ActiveChart.SetSourceData Source:=Range(Range("'Financial Assessment Raw Data 1'I171").Offset(Range("'Financial Assessment Raw Data 1'J196"), 2), Range("'Financial Assessment Raw Data 1'I171").Offset(Range("'Financial Assessment Raw Data 1'J196"), 47))
ActiveSheet.Shapes("Chart 2").Chart.SeriesCollection(1).XValues = Range("'Financial Assessment Raw Data 1'K172:BD172")
End Select
End Sub
I keep getting a "method range of object _global failed" error
Bookmarks