Create Chart using VBA and Ignoring Rows with #N/A

sndameron

New Member
Joined
Sep 21, 2014
Messages
27
Below is a sample of data. First column is the x-axis, second is the y -axis. I need to create a scatter plot of the below data in vba. I do not want it to plot the row with the #N/A in but rather have it just ignore that row and continue plotting the rest of the data. Filtering the data is not possible.

Much appreciated!
21
82
223
404
#N/A5
56
257
138
259
110

<!--StartFragment--> <colgroup><col width="65" span="2" style="width:65pt"> </colgroup><tbody>
<!--EndFragment--></tbody>
 

Some videos you may like

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
If I plot all your data I only get 9 points on an XY(Scatter) Chart. In other words the #N/A is ignored automatically.
 

sndameron

New Member
Joined
Sep 21, 2014
Messages
27
I know it it appears that it doesn't plot that point but the problem is that I'm running another script after this that shades everything to the left of the curve and the problem is when it does that because that cell is part of the series the script sees that #na as a zero. So the easiest solution is to get a script to create the series but omit any #na

If I plot all your data I only get 9 points on an XY(Scatter) Chart. In other words the #N/A is ignored automatically.
 

Watch MrExcel Video

Forum statistics

Threads
1,108,924
Messages
5,525,654
Members
409,658
Latest member
Yardcell

This Week's Hot Topics

Top