# Microsoft Office Application Help - Excel Help forum > Excel Charting & Pivots >  >  How do you link the axis bounds of a scatter graph to a cell? +How to insert target lines?

## Anonymousman23

I have set up a scatter chart on excel to map 2 columns of data. However, I would like to match the minimum and maximum values each of each axis to the minimum and maximum of their respective columns. This means matching each bound to a single cell. Any ideas as to how to do how to do this? I know that you can just set the bounds to automatic, but I would like to set them to the exact value of the cell (and make it change as the value of the cell changes).

As a second question, does anyone know how to set up a horizontal target line based on a single cell? I read somewhere that you can use error bars to have the same effect, but the problem is that they have a fixed length. I want to have its length spanning the whole of the displayed x-axis, even if the axis changes. Thanks in advance for any help

----------


## MrShorty

> I read somewhere that you can use error bars to have the same effect, but the problem is that they have a fixed length.



 Your version of Excel does not have any of the other error bar options? When I see this done, usually I see one set the error bar length option to percentage and the value to something suitable (like 100%). Perhaps I am not understanding exactly what you are doing, but I would expect if you position the dummy point for your target line correctly and use an error bar length of 100%, you will get a suitably flexible target line.

As for linking axis limits to cells, this requires VBA (are you allowed to use VBA for this project?). The most complete tutorial I am aware of is Jon Peltier's: https://peltiertech.com/chart-udf-control-axis-scale/

----------

