Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating a Y axis min value in Excel

Status
Not open for further replies.

Bumpthis

IS-IT--Management
Nov 5, 2001
16
GB
Hi

i have a series of data which needs to be put into a graph, the problem i have is that i do not want the min value (Y) axis scale to be set to 0 or auto and a number i type into the format axis properties, i need it to look at the lowest value in my table and set it to another value calculated in another cell not listed in my table so if the lowest value in my table is 500 my other cell may result in it being 400 and this is needs to be the min value in my Y axis.

Many thanks in advance
 
This can only be done in a macro.

Do you have any experience of macros?

You need some code like this:
Code:
    ActiveSheet.ChartObjects(1).Activate
    ActiveChart.Axes(xlValue).MinimumScale = ActiveSheet.Range("E2").Value
altered to suit your needs.

You may want to put the code inside the Worksheet_Change event, so that the axis will rescale automatically when values in the sheet are changed.

Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top