ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro to create a chart (https://www.excelbanter.com/excel-programming/293011-macro-create-chart.html)

alldreams

macro to create a chart
 
what's missing so I can run it successfully.

Sub Macro5()

CHARTS.Add
ActiveChart.ChartType = xlLine
ActiveChart.SetSourceData Source:=Sheets("DATA").Range
("A1:BJ145"), PlotBy _
:=xlRows
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Values = "=DATA!
R6C2:R6C256"
ActiveChart.Location Whe=xlLocationAsNewSheet
ActiveChart.HasLegend = False
End Sub

acw[_2_]

macro to create a chart
 
Hi

What is your error message. Worked for me.

Tony
-----Original Message-----
what's missing so I can run it successfully.

Sub Macro5()

CHARTS.Add
ActiveChart.ChartType = xlLine
ActiveChart.SetSourceData Source:=Sheets("DATA").Range
("A1:BJ145"), PlotBy _
:=xlRows
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Values = "=DATA!
R6C2:R6C256"
ActiveChart.Location Whe=xlLocationAsNewSheet
ActiveChart.HasLegend = False
End Sub
.


Jon Peltier

macro to create a chart
 
I have some hints on charting and VBA he

http://peltiertech.com/Excel/ChartsH...kChartVBA.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
http://PeltierTech.com/Excel/Charts/
_______


alldreams wrote:

what's missing so I can run it successfully.

Sub Macro5()

CHARTS.Add
ActiveChart.ChartType = xlLine
ActiveChart.SetSourceData Source:=Sheets("DATA").Range
("A1:BJ145"), PlotBy _
:=xlRows
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Values = "=DATA!
R6C2:R6C256"
ActiveChart.Location Whe=xlLocationAsNewSheet
ActiveChart.HasLegend = False
End Sub




All times are GMT +1. The time now is 03:33 PM.

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