Source of Pie Charts using Loops

  • Thread starter Thread starter anupam
  • Start date Start date
A

anupam

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
 
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/
_______
 
Back
Top