Name

chart.DataTable

Synopsis

Returns the DataTable object for the chart. Make sure the HasDataTable property is True before using this object. For example, the following code adds a data table to a chart and makes the table’s font italic:

Sub GetDataTable(  )
    Dim chrt As Chart
    Set chrt = Charts("New Chart")
    chrt.HasDataTable = True
    chrt.DataTable.Font.Italic = True
End Sub

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.