Reading data for chart

January 7th, 2009 by rose
  • Dear all,

    I have a problem regarding how to write a VBA code to read data for making a chart.

    I did following :

    Sub UpdateChart(item)
    Dim TheChart As Chart
    Dim DataSheet As Worksheet
    Dim chart_data(1268) As Double
    .............................

    Set TheChart = Sheets("plot")
    Set DataSheet = Sheets("Analytics")

    .................................

    For i = 2 To 1269
    chart_data(i - 1) = DataSheet.Range("E30:E1298")(i).Value
    Next i

    With TheChart
    .SetSourceData DataSheet.Range("E31:E1298")
    .ChartType = xlLine
    .Deselect
    End With

    ........................

    It is working fine. But if I put ".SetSourceData = "chart_data"" I am getting error as : Argument not optional (Error 449). Can anyone tell me wjhat will be the correct approach?

    Rgds,


  • Howdy. There is a difference between charts and chart objects. Jon Peltier (http://peltiertech.com/Excel/ChartsHowTo/QuickChartVBA.html) provides a helpful introduction to this.







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Reading data for chart , Please add it free.

    Posted in ncgloryholes.com | edit

    Cycling Idol Faced With More Doping Allegations Los Angeles, Ca - Home and Garden