Adding Chart problem

Joined
Apr 26, 2010
Messages
2
Reaction score
0
I have a problem when I try to run the below code for drawing a chart form data range in Excel sheet , for example the data in column E vs. column A as Xvalue, note that the end of the data range are variable , so I declare a variable called myD as integer for first limiting the end of the data series range

So could you advice?

------------------------------------------
Sub Button9_Click()
'
'
Dim myD As Integer

myD = Columns(6).End(xlDown).Row
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlLine
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "=""|Fr|"""
ActiveChart.SeriesCollection(1).Values = Range(Cells(1, 6), Cells(myD, 6))
ActiveChart.SeriesCollection(1).XValues = Range(Cells(1, 1), Cells(myD, 1))


End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Bubble Chart 1
No Data Lables 2
Chart source data 3
Floating Chart? 1
add a chart in a Add-In 1
Error Creating Chart 1
Issue with Multiple Graph Creation in VB 1
Help 0

Top