Excel 2007 - How to specify chart min in VBA

I have an Excel page with two scatter graphs and I need to specify the vertical axis min to equal a value calculated in a sheet cell.

I am having trouble specifying the component and property to change. I am a beginner in VBA. I can get to the code page for the sheet that contains the graphs but I can find to reference to the graphs or their properties. In some online material it mentions a column on the right which I think contains the info I want, but I have no such column when looking at the code page.

I could use help in two ways: 1) Tell me the code to write to specify the minimum for each of two graphs on one page and 2) Help me navigate the UI to find graphs and properties myself.

Thank you for your comments. My actual need is to set "Graph 3" on the sheet to one value and "Graph 6" to another value. I'm getting close to doing that. Also, in your example, it appears necessary to set ws to the value of the current sheet. Isn't there a way to make the sub with the current sheet implicitly, without having to specify the sheet.

The overall situation is that I have twelve sheets, one for each month and the Graph 3 minimum is in Cell D36, and the Graph 6 minimum is in D37. I also have a sheet for the year with its minimums in the same locations.

I've found I can do a better job of scaling than Excel, so I'm going to do both max and min for each graph.

I want to control other features of the graph, for example, the Title, but I have not been able to access a list of properties of graph that can be changed. Does that have a quick and easy answer, or should I ask a new question?

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…

The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …