ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   Odd Chart Format Results (https://www.excelbanter.com/charts-charting-excel/447831-odd-chart-format-results.html)

Hans Hamm

Odd Chart Format Results
 
I have two sheets with charts on both... Sheet1 and all it's charts are dead on.
However, when I copied the code from Sheet1 to Sheet6 I am getting "odd things" happening.
The Chart(s) are repeated 5 times using different data represented by the "Range("A"...." line of code

Here is the opening code:
With Sheet6
.Shapes.AddChart.Select
ActiveChart.ChartType = xlCylinderBarClustered
ActiveChart.SetSourceData Source:=Range("A" & lFirstRow & ":B" & lLastRow)
End With

I should be getting just a basic Cylinder Bar Chart. The first chart comes out correctly formatted based on the code(all the Cylinders are the same color, the series are correct etc...)=SERIES(Sheet6!$B$248,Sheet6!$A$249:$A$278, Sheet6!$B$249:$B$278,1)
but the other four charts =SERIES(Sheet6!$A$198,,Sheet6!$B$198,1) are giving me individual horizontal series as well as coloring the cylinders different colors.
I cannot figure out why I am getting two different results.
Any ideas would be appreciated!

Claus Busch

Odd Chart Format Results
 
Hi Hans,

Am Wed, 12 Dec 2012 06:00:49 -0800 (PST) schrieb Hans Hamm:

Here is the opening code:
With Sheet6
.Shapes.AddChart.Select
ActiveChart.ChartType = xlCylinderBarClustered
ActiveChart.SetSourceData Source:=Range("A" & lFirstRow & ":B" & lLastRow)
End With


all ranges between "With Sheet6" and "End With" must have a point in
front of the range keyword, e.g. .Range("A".... or .cells(1,1) to
refere them to the sheet


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2


All times are GMT +1. The time now is 05:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com