0

I am new to VBA and have not had experience with creating many charts.The chart has to be created by hand because the data has to be visually inspected to see if it meets certain criteria, and not every cell in a column needs to be added to the chart. The chart is to show information for each asset. Not every asset will have information that can be entered on the graph. Is there a way to use VBA to conditionally add data points to a graph?

For example if an asset sees values between 0-30 plot a dot (green) 30-50 (red) etc.

Jacob Heglar
  • 11
  • 1
  • 3
  • Please provide an example of the chart. an explination of the X and Y axis or even an image of it would provide information that may help us help you with an answer. – MatthewD Jul 30 '15 at 23:54
  • I do not have enough points to post a picture. I tried to do this – Jacob Heglar Jul 31 '15 at 13:04
  • Please explain the data that your chart is build from. Rows, Columns, Values.. – MatthewD Jul 31 '15 at 13:07
  • So I am looking at 8 different Columns (lets say B-I) The data is organized by serial no For Column B its a list of serial numbers and for each individual serial number i need a data point (but these numbers can repeat. Column C I only need to plot the last value for each serial no Column D I need to see if the serial no has any values > 0 and put a data point and count the times a cell is great than 0... I can keep going but explaining this takes visuals. I just want to know if you can do conditional data addition to a scatter plot via vba – Jacob Heglar Jul 31 '15 at 15:09

1 Answers1

1

Such a scenario can be achieved with data layout and formulas. No need for VBA, which would need to be re-run, where as formulas will update automatically.

Consider the following screenshot:

enter image description here

The formula in cell C3 is =IF($B3<30,$B3,NA()) and in D3 =IF($B3>=30,$B3,NA()) copied down.

teylyn
  • 34,374
  • 4
  • 53
  • 73