How to loop through data in a table and add it to a Chart
<p>The problem I am trying to solve using Excel VBA is with a table of information that I want to loop through and add to a Chart.</p>

<p>For example, the data file is in the following format:</p>

<pre><code> -696.710022 48 0 
 0 415.853546 2 1
 5 417.769196 2 1
 10 419.684845 2 1
 15 421.600464 2 1
 20 423.516113 2 1
 ......
 -602 48 0 
 0 371.893372 2 1
 5 373.851685 2 1
 10 375.810028 2 1
 15 377.768372 2 1
 20 379.726685 2 1
 ......
 -497.76001 48 0 
 0 323.194183 2 1
 5 325.189819 2 1
 10 327.185486 2 1
 15 329.181152 2 1
 20 331.176819 2 1
 ......
 etc.
</code></pre>

<p>In this file if Column 3 = "0" this is a header Row where by:</p>

<pre><code>column 1 = location, 
column 2 = number of points at location, 
column 3 = header flag (i.e. "0")
</code></pre>

<p>The rest of the Rows are the data:</p>

<pre><code>column 1 = X value,
column 2 = Y value,
column 3 = colour of points (i.e. 1 = green, 2 = blue, 3 = red).
</code></pre>

<p>I would like to run this in VBA because I have 40 or so of these charts to make. I have struggled making a script for VBA beyond importing a chart so I have not included my code here.</p>

<p>I really do appreciate any advice or suggestions on how to solve this.</p>

<p>Thank you :)</p>