Re: Using other than Range as SetSourceData method argument

From: Jon Peltier (DOjonNOTxlmvp_at_SPAMpeltiertechME.com)
Date: 09/14/04


Date: Tue, 14 Sep 2004 13:48:23 -0400

It takes a little more work. In VBA, set up the X and Y value arrays for
each series. Then add the series one by one:

   Dim Srs as Series
   With ActiveChart.SeriesCollection
     Set Srs = .NewSeries
     With Srs
       .Values = Yarray
       .XValues = Xarray
     End With
   End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

CKa wrote:

> Hi.
>
> I have been trying to find another way to populate a chart in some VBA code
> than using a range as a argument for the SetSourceData method of the Chart
> object.
>
> I get a lot of external data (from a database) into an array of 2 dimensions
> (x and y). Is it possible to use this array to as a datasource without first
> having to populate some cells with the array and then use these cells as a
> Range property for populating a chart?
>
> Thanks in advance,
>
> CKa.
>
>



Relevant Pages

  • Re: Please help me pass an array from VBA to Perl and populate it. Newbie at wits end!
    ... I want to pass an empty container for a set of strings from VBA into ... Perl, do some stuff in Perl, and populate the Collection with a set of ... I operatoe on it in Perl as an array? ... Do I have to populate my own Perl array and then do something ...
    (comp.lang.perl.misc)
  • Re: Please help me pass an array from VBA to Perl and populate it. Newbie at wits end!
    ... I want to pass an empty container for a set of strings from VBA into ... Perl, do some stuff in Perl, and populate the Collection with a set of ... I operatoe on it in Perl as an array? ... Do I have to populate my own Perl array and then do something ...
    (comp.lang.perl.misc)
  • Please help me pass an array from VBA to Perl and populate it. Newbie at wits end!
    ... I want to pass an empty container for a set of strings from VBA into ... Perl, do some stuff in Perl, and populate the Collection with a set of ... I operatoe on it in Perl as an array? ... Do I have to populate my own Perl array and then do something ...
    (comp.lang.perl.misc)
  • Using other than Range as SetSourceData method argument
    ... I have been trying to find another way to populate a chart in some VBA code ... I get a lot of external data into an array of 2 dimensions ... having to populate some cells with the array and then use these cells as a ...
    (microsoft.public.excel.charting)
  • charting newdata
    ... Formula or VBA? ... I am trying to create a formula to assign a region to populate a chart. ... create a formula to assign a 'chart data area' or simply reassign the data ...
    (microsoft.public.excel)

Loading