Excel VBA charts - how to set row and column labels
<p>I'm trying to follow along this tutorial:</p>

<p><a href="http://www.homeandlearn.org/vba_charts_sheets.html" rel="nofollow">http://www.homeandlearn.org/vba_charts_sheets.html</a></p>

<p>Here is as far as I've gotten:</p>

<pre><code>Sub MakeChart()
    Dim ChartSheet1 As Chart
    Set ChartSheet1 = Charts.Add
    With ChartSheet1
        .SetSourceData Source:=Sheets("clc_hgn_hgn").Range("C3:AO41")
    End With
End Sub
</code></pre>

<p>The problem is that Excel automatically assumes the column and row headers are in the data source, when in my worksheet they are not. How do I get Excel to retrieve the headers from different ranges?</p>

<p>For instance, in my worksheet the data is contained in the range C3:AO41, but the horizontal top headers are in C1:AO1 and the vertical left headers are in A3:A41.</p>