VBA code to return the data series of a chart or graph

HELP! Does anyone know of some VB or VBA code which will return the dat
series on which a chart or graphis based. I have a column chart and ca
check that it has a title:

.ActiveSheet.ChartObjects(1).Chart.HasTitle

as above!

However I cannot find any method which returns the range of cells o
which a chart is based.

Any ideas welcomed to this forum or email:

acs@dulwich.org.uk
dracstorey@hotmail.com

Many thank

--
Message posted from http://www.ExcelForum.com

0
1/14/2004 12:01:49 PM
excel.charting 18370 articles. 0 followers. Follow

4 Replies
422 Views

Similar Articles

[PageSpeed] 24

Try John Walkenbach's http://j-walk.com/ss/excel/tips/tip83.htm

-- 
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article <dracstorey.100t4z@excelforum-nospam.com>, dracstorey 
<<dracstorey.100t4z@excelforum-nospam.com>> says...
> HELP! Does anyone know of some VB or VBA code which will return the data
> series on which a chart or graphis based. I have a column chart and can
> check that it has a title:
> 
> ActiveSheet.ChartObjects(1).Chart.HasTitle
> 
> as above!
> 
> However I cannot find any method which returns the range of cells on
> which a chart is based.
> 
> Any ideas welcomed to this forum or email:
> 
> acs@dulwich.org.uk
> dracstorey@hotmail.com
> 
> Many thanks
> 
> 
> ---
> Message posted from http://www.ExcelForum.com/
> 
> 
0
1/14/2004 12:15:01 PM
Hi dracstorey,

Check out Jon's tutorial pages,
(http://peltiertech.com/Excel/Charts/ChgSrsFmla.html)

dracstorey < wrote:

> HELP! Does anyone know of some VB or VBA code which will return the data
> series on which a chart or graphis based. I have a column chart and can
> check that it has a title:
> 
> ActiveSheet.ChartObjects(1).Chart.HasTitle
> 
> as above!
> 
> However I cannot find any method which returns the range of cells on
> which a chart is based.
> 
> Any ideas welcomed to this forum or email:
> 
> acs@dulwich.org.uk
> dracstorey@hotmail.com
> 
> Many thanks
> 
> 
> ---
> Message posted from http://www.ExcelForum.com/
> 

-- 

Cheers
Andy

http://www.andypope.info

0
andy9699 (3616)
1/14/2004 12:26:21 PM
Tushar

many thanks. The link was great and I have nearly integrated it into my
code. Just a couple of fixes needed!

Andrew


---
Message posted from http://www.ExcelForum.com/

0
1/18/2004 8:47:19 PM
You are welcome.  Glad to be of help.

-- 
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article <dracstorey.108w4t@excelforum-nospam.com>, dracstorey 
<<dracstorey.108w4t@excelforum-nospam.com>> says...
> Tushar
> 
> many thanks. The link was great and I have nearly integrated it into my
> code. Just a couple of fixes needed!
> 
> Andrew
> 
> 
> ---
> Message posted from http://www.ExcelForum.com/
> 
> 
0
1/20/2004 3:52:36 PM
Reply:

Similar Artilces:

How do I flip a bar chart?
I need to have two bar charts that I want to display back to back ( so that the one on the left's bars go out toward the left and the one on the right's bars go out toward the right). How can I flip one? Kristen wrote on Fri, 5 May 2006 10:05:01 -0700: K> I need to have two bar charts that I want to display back to K> back ( so that the one on the left's bars go out toward the K> left and the one on the right's bars go out toward the K> right). K> How can I flip one? Would the "values in reverse order" option for the x-axis scale do what y...

How do I add an additional X axis in a chart
I have a chart that needs two sets of data to be presented relative to a fixed Y. My 'Y' axis is 'fixed' (in this case depth) the X axis values/series need two seperate scales (in this case 1, pressure readings and 2, an arbitrary point value.) Ideally I would like the pressure axis (1st X) to be at the top of the chart, arbitrary point values along the bottom (2nd X) of the chart. The chart is a standard type - XY scatter Thanks for any help or ideas Add both series to chart. Move one to secondary y-axis (double-click series, select Axis tab, select 'Secondary...

Lines in line chart are "agglomerating" data
Elementary problem. I have about 2 months worth of daily piece counts=about 60 data points. Piece count (Y axis) against date (X axis). Excel keeps bunching the line data into weeks. The Base Unit for the X axis is "Days," Major Unit is 2 days and Minor Unit is 1 day. Why can't I get ALL data points (all 60 days) plotted separately? Why is it rounding up to weeks? Thanks. I am not sure how to reproduce the problem that you are getting, but as a general suggestion, try using an "XY (Scatter)" chart instead of a "Line" chart. The "Line" chart...

How to code an Invouce Number
I have a bad habit of using "autonumber" too much and in the wrong places. SO I need some suggestions for creating an invoice numbering system that increments by one with each new order but does not increment if the order was not completed. And maybe some way to show as "voided" if an order was cancled. Thanks much, dave You can just use a DMax() in the BeforeInsert event and in the BeforeUpdate event IF Me.NewRecord. Dave wrote: >I have a bad habit of using "autonumber" too much and in the wrong places. > >SO I need some suggestions for creating...

VBA Functionality Lost
On one of my office computers whenever I try to open one of the add-ins I am notified that the ActiveX Controls & VBA part is lost. Even VBE doesn't open. Could there be some kind of restriction implemented by the Administrator? How to have the same functioning? -- Thanx in advance, Best Regards, Faraz The Active-X components you DLL. To find out which DLL are being used if you go to the VBA menu Tools - References you will see the a list of libraries used by the project. The DLL for those object. If you select each of the libraries with the mouse the name of ...

Serializing objects to JSON with properties that return interfaces
I want to serialize and deserialize an object to and from JSON. My code looks something like this: http://pastebin.com/yB5idwNq This gives me an error like this: System.Runtime.Serialization.SerializationException: Type 'MyObject1' with data contract name 'MyObject1:http://schemas.datacontract.org/ 2004/07/namespace' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer. I am only using ISerializable be...

graphing question
I have a series of graphs based on data of 5 variables for 10 countries There is a graph for each variable, and they are sorted by rank. I there any way to make it so that each country has the same color bar i each graph? For example, the bar for the "US" is blue in every graph regardless of the position? Thanks -- anantathake ----------------------------------------------------------------------- anantathaker's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1813 View this thread: http://www.excelforum.com/showthread.php?threadid=37995 ...

Need to make a "dartboard" chart
Hi I need to make a business chart in order to track percentages; the idea is that it's circular, with the centre being 100% and the outside rim being 0%. Each department will have a "dart" (i.e. a point on the chart) showing what percentage they've achieved, the closer to the centre the better. Is there a template anywhere which might help me with this? In article <379A9683-0675-4596-94A6-6E532F4D5634@microsoft.com>, Camerhill@discussions.microsoft.com says... > Hi > > I need to make a business chart in order to track percentages; the idea is > tha...

Fill in Column with a series of repeating numbers
I am trying to fill in an amortization years column. The first 12 rows are "1", the next 12 rows are "2", the next twelve rows are "3" and so on. I've got 360 rows to fill. Any suggestions? A1: 1 A2: =IF(MOD(ROW(),12)=1,A1+1,A1) Fill down -- Jim Cone Portland, Oregon USA ( Review of Special Sort add-in: http://www.contextures.com/excel-sort-addin.html ) "mimi" <mimi@discussions.microsoft.com> wrote in message I am trying to fill in an amortization years column. The first 12 rows are "1", the next 12 ro...

Scatter Chart data #2
That would be great, but the boss does not want blank cells - if it's blank then it is assumed the data is just not entered for that date. That is why I created the whole shaded cells bit - unfortunately the idea was not well received.... I guess I have to face the fact that I will be spending a lot of time on this...Thanks for the suggestion! Robin Jon Peltier Wrote: > You can do Find-Replace to remove the asterix. Since an asterix is a > special character, enter ~* in the Find box; make sure the Replace > With > box is empty. > > Then teach the analyst to keep blan...

Simple graph #2
I have a range of data corresponding to several years: Year Amount 1997 100 1998 150 1999 200 2000 250 etc How can I display a graph with this range that shows the amounts in a bar graph on the Y axis and the years along the bottom on the X axis. If I use the wizard it tries to compare 1997 to 100 which is obviously not what I want to do. Hi, The quickest way is to clear the cell that contains the word Year and then use the wizard. Excel is trying to help you, although not successfully, by using the column headers as a clue that you have two data series. Cheers Andy Ant...

A chart with 2 datas
Hi, I'm trying to plot a chart whereby Status Type open defect closed CR open CR closed defect I need to chart all those defects that are open or closed only not including CR I'm using COUNTIF for open and closed. I hope this makes sense. To plot a chart you need numbers. Use your worksheet to produce the numbers you want, then you can plot them on a chart. -- David Biddulph "ymcj" <june.ymc@gmail.com> wrote in message news:5300e951-0375-4...

Confused about where to put code
In a module I have a procedure called 'missingdata() that checks if certain form fields are filled. If not, the user is asked to first enter the fields. Missingdata() returns true if data is missing. If the fields �re filled the current record is being saved by: if . dirty then .dirty = false. I call this procedure every time I need to make that the record is complete and saved, for instance for composing an email which uses the field values. If missingsdata() returns true I quite the calling procedure. Now in the form's beforeupdate I also call missingdata(), since if...

how do I import data in excel form SQL server?
Hello All, I've been trying to import data into excel from our SQL server. I have the sql script yielding the results. The real problem is when I use the data connectivity wizard, it only allows you to select one table from the database in your SQL server. However, my script involves two tables with a join. Any ideas would be helpful Thanks, Mitch Asuming you have rights on the Server, convert your 'script' (by which you probably mean query?) into a view. If you don't have adequate rights, then use MS Query to connect to SQL Server and use your que...

can the doughnut chart key be in words
i have a balance sheet the has to be presented in a doughunt chart but the key has to be in words. using office 2003. if it is possible please could i have a step by step explanation Hi, The key will display the text you specify as the Name of the series. Normally the text is held within a cell at the head of each data series. You can use the Source Data dialog to set the Name of each series, either as a reference to a cell or text. Right click chart and pick Source Data... On the series tab is the place to change the Name. Cheers Andy lili class wrote: > i have a balance sheet the ...

How to solve a formula so that it returns actual answer if negati.
I am trying to write a formula so that it displays all negative results but defaults to zero if the answer is any positive number. Hi try =MIN(your_formula,0) -- Regards Frank Kabel Frankfurt, Germany Wayne wrote: > I am trying to write a formula so that it displays all negative > results but defaults to zero if the answer is any positive number. Hi. Try: =MIN(your_formula,0) HTH Jason Atlanta, GA >-----Original Message----- >I am trying to write a formula so that it displays all negative results but >defaults to zero if the answer is any positive number. >. >...

List box value returns the row number of the list box range row
Hi, I was hoping someone could help me figure out what I am doing wrong. I have a list box set up on a worksheet and I want the user to select a value from the list box, and then have that value entered into a cell when a button is clicked. When I run/step through the macro, it takes a value and places it into the appropriate cell. The problem is that the value which is placed in the cell is not the value from the listbox, but the row number of the value that was chosen. Using the below row numbers and values as an example; if I select value 7 from the list box, the val...

Line Chart Query
Hi, I am trying to put together a line chart of some information. The problem is that it looks quite crowded on the chart. Is there a way of having a line chart where you can select a few of the data sources to see just those lines, without having to have a different chart for each data source? My ideal situation would be where I have 18 data sources, and I can click between those 18 and see line charts for those 18 individually, or any combination of them without having to have several line charts. Thanks. Have you tried a filter (such an an auto-filter) on the source dat...

VBA #8
I received an answer to my yesterday query which included using a VBA procedure. I have NO idea what a VBA procedure is. Please explain. FL Kulchar 1. You seem to assume we all know what question you posted and why you received an answer using VBA. Post a follow up in the same thread so anyone can see what went on before. You could at least (assuming you have access to the internet) do www.google.com search, go to microsoft.com and type in VBA procedure in the search box here's a link that might be of some use http://www.excel-vba.com/ Regards, Peo Sjoblom "FLKULCHAR&...

format a specific letter by code
Hi there, when text is copied to a new sheet by code, I need a specific letter (v) made bold and red to indicate to the user that the words on either side of it are seperate. A good analogy would be football teams, so for instance: Real Madrid v Real Betis. Here the 'v' between the names would be red and bold. Valencia v Villa Real. I only want the 'v' seperating the team names to be formatted as above. Any ideas? Thanks. -- Traa Dy Liooar Jock Sub findvSAS() For Each c In Range("a1:a22") If InStr(c, " v ") Then 'MsgBox c.Row x...

Comparing Data from three separate reports
I have three reports that I want to be able to extract the data that is the same in all three under column a and b. Basicaly I want to find the account number and name that are the same on all three reports, and be able to extract the entire line of data on each. example would be a finacial company looking for a client that has not paid a bill in three consecutive months. ...

Bar or Column Charts With Weighted Width
For many of my reports that are on a monthly category basis, I would like to reflect the weight of each month's significance by varying its presence on the category axis. Currently, I show the value for each month/category, but the width of each month is the same. Keen business users know some months are more significant than others, but it would be really great if I could depict this distribution well. Marimekko seems to cross paths with my need but I'm not really sure if it is the solution. Can anyone suggest ideas? You may want to try making a Cascade chart: Variable Widt...

search data
I need to seach a cell range (C2: C last cell) for a specific string. Once found i need to delete the entire row and continue searching. Can someone help me with this? Thanks. search help for find next. -- Gary Keramidas Excel 2003 "Daniel M" <DanielM@discussions.microsoft.com> wrote in message news:9B86D78C-9BEB-4BFC-9181-0F0C082866A1@microsoft.com... >I need to seach a cell range (C2: C last cell) for a specific string. Once > found i need to delete the entire row and continue searching. Can someone > help me with this? Thanks. hi, Dani...

Boston Chart
How do I create a Boston Chart in Excel? What is a Boston chart? Google was of not help to me best wishes -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "Lily" <Lily@discussions.microsoft.com> wrote in message news:FC8CBCB7-EF62-462A-B8DC-7CDA0AC82FA5@microsoft.com... > How do I create a Boston Chart in Excel? It could be the pie-as-bubble-chart-marker made popular by the Boston Consulting Group. Andy Pope has a tutorial here: http://andypope.info/charts/piedatamarkers.htm - Jon ------- Jon Peltier, Microsoft Excel M...

Charts in Sheet
How come...when you change the source data...in other words...expand the data series to incorporate new data within a chart.. save changes then, exit the chart,..... the cursor moves to the top of the spreadsheet?? Why is this so? Why can't my mouse (cursor) stay in and around the chart??? Larry ...