?
Solved

Dynamic chart data source...

Posted on 2014-04-20
1
Medium Priority
?
285 Views
Last Modified: 2014-04-21
There is a line chart with "Chart data range" of :

ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).Select
ActiveChart.SetSourceData Source:=Range("$D$1:$AA$1")

I want to add a 2nd dynamic series to this "Chart data range".

The second set will have values like:

0, 0, 0, 0, 10, 0, 0,0,0,0,....0
^--col1       ^--col 5            ^-- col24

D to AA are 24 columns. I am trying not having these zeros and 10 on the worksheet rather to be fed as digits if possible at all.

Question: How can amend the new series composed of zeros and another non zero number in the mix without having them typed on a worksheet?


Thank you.
0
Comment
Question by:Mike Eghtebas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 23

Accepted Solution

by:
Ejgil Hedegaard earned 2000 total points
ID: 40012912
Add this

ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(2).Values = Array(0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)

Open in new window

0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question