Source of Pie Charts using Loops

I want to run a loop which will set the data source of all piecharts i
a single worksheets.
Source of Chart1 is in Cells(5,3) and Cells(5,4)
Source of Chart2 is in next row and same coloumn.
There are 30 charts and I want to run a loop which will set the source

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

0
7/27/2004 6:11:00 PM
excel.charting 18370 articles. 0 followers. Follow

2 Replies
572 Views

Similar Articles

[PageSpeed] 57

Without any error checking:

dim rng as range
dim i as integer

with activesheet
   set rng = .range(.cells(5,3),.cells(5,4))
   for i=1 to .chartobjects.count
     .chartobjects(i).chart.setsourcedata _
       source:=rng.offset(i-1,0)
   next
end with

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

anupam < wrote:

> I want to run a loop which will set the data source of all piecharts in
> a single worksheets.
> Source of Chart1 is in Cells(5,3) and Cells(5,4)
> Source of Chart2 is in next row and same coloumn.
> There are 30 charts and I want to run a loop which will set the source.
> 
> 
> ---
> Message posted from http://www.ExcelForum.com/
> 

0
7/27/2004 7:44:30 PM
Thanks, Jo

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

0
7/27/2004 10:16:57 PM
Reply:

Similar Artilces:

Dynamic chart not updating correctly.
Oh Wise Ones, I posted a similar question a few weeks ago, but I have more to add. I have a range (C4:C23) that dynamically pulls data from a sql server every 2 seconds and updates every 2 seconds. The problem is the chart I have attatched that graphs this range will not update even though I can see the values changing in the cells. What I have noticed since my last post, is that while I run WinXP/Excel XP, there is another station running Win2000/Excel 2000 that has a chart that updates dynamically. What gives? Thanks, Mike ...

Why is .NET 2.0 required to deploy an app using VC2005 C++ Setup project?
I just created a setup project for my mfc app. I noticed that in the prerequisites section the .NET 2.0 is checked by default. My app does not need the framework (at least this is what I think). If I clear the checkbox, build the project, and then try to deploy it on a machine with ..NET 1.1 the installer fails with a message complaining about missing .NET 2.0. I'm not sure if this the installer that needs the framework or my app. Are there any mfc8 dlls dependant on the framework? Thanks Hi, > I just created a setup project for my mfc app. I noticed that in the > p...

Chart Value Changes in VBA
When you have say a bar chart and drag the bar downwards this will change the value in the reference source cell. Is there a way through VBA to identify the source and the cell changed by when dragging the bar. That is, when you drag the bar in the chart let me know the cell that ahs changed! Any help would be appreciated. Thanks in advance. Howard John, If your objective is to prevent the cell changes via the chart, you can protect the worksheet (Tools - Protection). The cells should be locked (Format - Cells - Protection). Or you can use the Chart_SeriesChange event macro for the cha...

Pivot table chart problem, How to show different subtotal levels
Hi, Using Excel 2003, I have a pivot table using external data via ODBC. I have a chart based on my pivot table. The table and chart are working correctly. The PTcontains two levels of sales subtotals 1st level is by county 2nd level is by state. My client is telling me that the data in the chart is too detailed. He wants to have the both levels of subtotals in the PT, but only the county subtotals in the chart. If I delete the county sales subtotals from the chart, they are also deleted from the PT. Is it possible for the chart to be based on the PT and not show ...

VC++ 2005
I am attempting to compile a project in Visual Studio 2005 which compiles and links properly in VC++ 6.0. It seems to have problems with C++ i/o functions. Here is the error I get: g:\src\analyzer\digitdialpages.h(136) : error C2146: syntax error : missing ';' before identifier 'm_InFile' Line 136: ifstream m_InFile; The statment: include <fstream> is at the top of the source file. Some assistance would be helpful. We didn't have any problems with using ifstream or ofstream in VC++ 6.0. Thanks. On Tue, 12 Dec 2006 18:22:47 -0500, "Raj Kulkarni...

How to use Find (Ctrl-F) to find non-alpha
Is there some way to search a sheet for anything BUT a-z or A-Z? tx ;-) Finding numerals or a mixture of numbers and letters (and other characters) works ok for me. What are you having trouble with? On 10/22/2010 16:31, Heather Mills wrote: > Is there some way to search a sheet for anything BUT a-z or A-Z? > > tx ;-) -- Dave Peterson On Fri, 22 Oct 2010 17:54:28 -0500, Dave Peterson <petersod@XSPAMverizon.net> wrote: >Finding numerals or a mixture of numbers and letters (and other characters) >works ok for me. > >What are you having trouble with? > >...

Charting with concatenated numbers and text
I am scatter charting from columns of data (text and numbers) that I concatanate into a long string so that I can use the validate drop down list feature in Excel, which only supports one column. I use Mid, Left and Right functions to then pick the relevant charting data from the string. Unfortunately although the numbers look good, Excel does not treat them the same way that it does with directly entered numbers - and my charts do not display accurately. Any ideas to to fix this problem or suggest a modified workflow. I am not an advanced user but would like to use the drop down li...

Varying colors on a line chart with multiple series
In Excel 2003, is it possible to change the color of part of a line on a chart with multiple data series? I can do it on a single series chart. Hi, Yes, you would need to select the segment of the line and then format it. So select the series pause and then select the segment apply formatting Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "LKP" <LKP@discussions.microsoft.com> wrote in message news:CB5CF5B8-5E3C-4288-A7B1-63958DB0C688@microsoft.com... > In Excel 2003, is it possible to change the color of part of a line on a > chart with ...

Dynamic range in chart
Hi, I have created a named range called Net_CLI which has the following formula =INDIRECT("Trends!$C$4:$" & VLOOKUP(COUNTA(Trends!$B$4:$V$4),'Legend Sheet'!$B$31:$C$50,2,FALSE) & "$4") Presently I expect the vlookup part of the above formula to return H, so in all I expect the named range to give me ----> Trends!$C$4:$H$4 If I use the above named range in Data Validation, then I get the relevant values in drop down. But If I have a chart (in the same worksheet) in which for the first series in place of existing entry in the values textbox as =Trends...

Charts/Histograms
I am currently trying to no avail to make a frequency chart or a histogram. I have built my frequency graph or list and when I select the data (two rows) the insert-chart-colum function it plots the data for me but it is not correct. I want my frequency to be my vertical axis and my speeds to be my horizontal axis. I can not figure this out. Please oh please I'm desperate! I also need to make that histogram in to a polygon graph something like a line chart ploting the same data. -- hjt ...

How do I create custom border using peoples names?
There are many it could be done. I'd set up text boxes and go from there. -- JoAnn Paules MVP Microsoft [Publisher] "Val" <Val@discussions.microsoft.com> wrote in message news:BFF16BB3-4C90-4E05-B0AA-303874A445AA@microsoft.com... > In addition to JoAnn's reply, you could use WordArt as well. WordArt allows you the opportunity to rotate, flip, arrange etc. and resize as well as save as an image. -- Brian Kvalheim Microsoft Publisher MVP http://www.publishermvps.com This posting is provided "AS IS" with no warranties, and confers no rights. &...

Change Chart Size
I was wondering if anyone knows how I can change the sizes of charts in excel. But i dont want to just resize by dragging the corners, i want to lock the aspect ratio, and change the width to 3.5 inches. So basically, i want to change the width of each chart to 3.5 inches exactly. Another problem I am having is when I copy and paste a chart from excel into powerpoint, all the changes to the size and text I made get changed so its not the copy I wanted. Is there any way to change this. 1) Resize using aspect ratio only after the chart is sucessfully in Powerpoint. 2) You get charts...

Waterfall chart
Hello I have a waterfall chart showing: Budget 20xx Variance type 1 Variance type 2 Variance type 3 Variance type 4 Variance type 5 =Revised budget 20xx In one month variance type 1, 2 and 3 may be negative and type 4 and 5 positive. In another month this may be different, for example that type 1 and 2 are negative while type 3, 4 and 5 are positive. Question: Is it possible to have bars showing negative variances in one color and positive variances in another? Hans Knudsen I know I can do it manually, but is it possible to do it automatically? Hans Knudsen "Hans Knudsen" &...

vlookup cant be used
I need a way to transfer data. I have one sheet that contains all information. All of this data needs to be transferred to a template ready for print. I have contemplated using a vlookup to quicken the method, although the data sheet will be moving too and from computers, and so the vlookup will not work. Is there any code that might possibly help me, i.e. a code that looks for the datasheet and does some sort of vlookup after it has located the file? Or should this problem be tackled using macros, although i imagine that this will have the same effect. How "ready for print"? Are...

Chart Print Footer :: Excel 2007
I create a chart using vba and I create it on it own worksheet (ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="UsageChart"). I need to setup the page footer so that when it prints, the date/time appear in the lower right-hand corner. I have tried using the following command to set it up: Worksheets("UsageChart").PageSetup.RightFooter = Format(Date, "yyyy-mmm-dd") but it does not work, nothing appears. What am I doing wrong? Thank you for your help, QB Chart sheet is not a worksheet. Sheets collection comprises worksheets and c...

how to remove non commercial use in the title bar in office
how to remove non commercial use in the title bar in office 2007 Buy an edition that is not for non-commercial use only. You own the Home and Student edition. -- JoAnn Paules MVP Microsoft [Publisher] Tech Editor for "Microsoft Publisher 2007 For Dummies" "Mario" <Mario@discussions.microsoft.com> wrote in message news:0E14F850-0B65-4093-926F-B680E1C7D6B1@microsoft.com... > how to remove non commercial use in the title bar in office 2007 ...

SOAP Server Application Faulted 80040217The specified object was not found.D:\crm\Build\3297\src\platform\include\OMCommon\entity.inl1542 Source: System.Web.Services #2
I get this exception when I execute this code to retreive a CRM contact. Any ideas as to what the proxy class is looking for that it cannot find. I do not have the directory structure the erro message calls for. Exception: SOAP Server Application Faulted 80040217The specified object was not found.D:\crm\Build\3297\src\platform\include\OMCommon\entity.inl1542 Source: System.Web.Services Code: // strServer should be set with the name of the platform Web server string strServer = "crm"; // virtualDirectory should be set with the name of the Microsoft CRM // virtual directory on the...

chart x-axis breaks
I have a line chart with dates on the X axis that range from 1/1/2001-Present and I'd like to show breaks at the end of each year. Is there a way to do this? I'd like the plot area to be different colors for each year if possible. ...

Problem with "Send as", when using "send on behalf of" in Exchange 2000.
I'm not able to set the "Send as" permission on a mailbox. The problem is that the access right is not present in "Mailbox Rights" ?. I have 2 users, A and B. All mail to B is forwarded to A, and B has added A to "Send on behalf of" in Active directory users and computers / Exchange general / Delivery options. When not being able to set the "Send as" creates the following problem: If A reply to a mail originally send to B (which is automaticaly forwarded to A) , the receiver sees A as the sender. Any idears. Thanks in advance Bo Jacob...

Unchangeable Charts
One version I have is Excel 2007. I have a spreadsheet with several charts. I cannot change any of the charts, including such thing as ranges, and scaling, etc. when I use Excel 2007. It is just as if the chart were just an image. I can make similar changes to other spreadsheets in 2007. Initially, I thought it might be a protection issue. However, I can make all the desired changes if I open the spreadsheet with Excel 2002 or Excel 2003. Can anyone explain why I am unable to make changes in 2007 when I can make the changes in other versions or other spreadsheets? ...

Invoke Web Service using a Client Application
Hi, I have a web serivce created that contains several methods that are NON-PRIMITIVE types - meaning I cannot test it directly from the browser. So, I thought of devloping a client application in .NET that can submit the XML request and receive the response. I created the application and it works; but the problem is, the user have to frame the XML each time as TEXT (build the XML) and then submit it which takes a long time. Is there a way that given the web service and the method, a windows form with controls dynamically be created based on the types?. These controls will basically ...

Sending MORE than one workbook AND using .CC and .BCC as well?
Using XL'03, using Ron's tips, I have successfully sent one workbook, or sheet or range but I would like to send more than one workbook. I have used VBA to put the files in a folder and zip and send them, but I do not wish to zip them. How can I d this and how can I also use the e.g. .To and .CC .BCC as well. Many thanks. Simon If you are using outlook, just loop through all files adding each as a separate file, just as the zip is added, and also set the .cc and ,bcc properties as you to with the .To property. HTH Bob "Simon" <simonlavender@...

Chart with Quadrants
I need to produce a chart and I don't know the name of it so that I can search Jon's Excel graph site and get info here. Any help would be appreciated. I need a graph where the X and Y axis meet at zero in the middle of the graph with positive and negatives numbers on both. My plan is to use this chart to analyze data as to what quadrant it falls into, eg. Quadrant I would be if the product was positive on the Y axis but negative on the X axis. Q2 = positive on Y, positive on X Q3 = negative y and negative Q4 negative y and positive x. I located the instructions from ...

Random number generator expression used
My final year (Statistics degree) project is concerned with the PRNG in MS Excel. It was stated by the lecturer in Simulation Studies that this PRNG was no good for simulation purposes .. the cycle length is not long enough. So that I can test this statement I need to be able to run the in-built PRNG so that it repeats the sequence of generated random numbers. This cannot be done in situ as there are not enough cells available (max 16k ?). I would propose to run the PRNG as a VBA macro - or stand_alone in VB6 - but for that I need to obtain the mathematical expression that is used ...

Try/Finally the only way to Exit nested For loops?
Hello - I was wondering if it is the best way to exit nested For loops by using an empty Try/Finally block? Is there any other "nicer" way of doing this in Visual Basic? Try For i ... For j ... If lError Then Return Nothing ' This will also enter the Finally block For k ... Exit Try Finally End Try Thanks, Joe On Feb 4, 7:45=A0am, Joe Duchtel <duch...@gmail.com> wrote: > Hello - > > I was wondering if it is the best way to exit nested For loops by > using an empty Try/Finally block? =A0Is there any other &...