Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Ketan Dave   on Jan 18 In MS Office Category.

  
Question Answered By: Maria Miller   on Jan 18


1. Remove or comment out this line:
ActiveChart.SetSourceData Source:=DataRange, PlotBy:=xlColumns

Since you already have the chart  in place you don't need to redefine
and plot. Since DataRange is only one column wide you end up only
plotting one series, therefore later when you refer to series 2 and 3
etc. it balks. Just make sure you have 3 series and the chart type as
you like it before running the macro.

2. The line
Set TimeRange = Range("Sheet3!C7").Resize(amtrows, 1)
I believe should be:
Set TimeFrame = Range("Sheet3!C7").Resize(amtrows, 1)
since you have no Dim statement for TimeRange, but have one for
TimeFrame!

3. You've done the same as before with the three lines:
ActiveChart.SeriesCollection(1).XValues = Range(TimeFrame)
ActiveChart.SeriesCollection(2).XValues = Range(TimeFrame)
ActiveChart.SeriesCollection(3).XValues = Range(TimeFrame)

TimeFrame is already a range so amend to:
ActiveChart.SeriesCollection(1).XValues = TimeFrame
ActiveChart.SeriesCollection(2).XValues = TimeFrame
ActiveChart.SeriesCollection(3).XValues = TimeFrame

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on VBA Help With Chart Object Problem Or get search suggestion and latest updates.


Tagged: