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

sndameron

New Member
Joined
Sep 21, 2014
Messages
30
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>
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
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.
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,215,343
Messages
6,124,394
Members
449,155
Latest member
ravioli44

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top