ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problems creating "line and bar chart" (https://www.excelbanter.com/excel-programming/286472-problems-creating-line-bar-chart.html)

Ariel[_2_]

Problems creating "line and bar chart"
 
when recording the macro, I didn't have problems creating the two series, one a bar, and the second a line. However, upon running the macro, both series appear as bars! I retried recording the macro and the same problem occurred

Please email me at !

Debra Dalgleish

Problems creating "line and bar chart"
 
When you look at the code that was recorded, it should look similar to this:

ActiveChart.ApplyCustomType ChartType:=xlBuiltIn, _
TypeName:="Line - Column"
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A1:G3")
ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet1"

Rearrage these lines, so the chart type is applied after the source data
and location are set:

ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A1:G3")
ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet1"
ActiveChart.ApplyCustomType ChartType:=xlBuiltIn, _
TypeName:="Line - Column"


Ariel wrote:
when recording the macro, I didn't have problems creating the two series, one a bar, and the second a line. However, upon running the macro, both series appear as bars! I retried recording the macro and the same problem occurred!

Please email me at !



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



All times are GMT +1. The time now is 10:36 PM.

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