Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
joe joe is offline
external usenet poster
 
Posts: 62
Default Get Max & Min from a chart series

How do you return the Max and Min value of a series on a chart? Assume there there is only 1 series plotted across a time variable

The logical way is to calc this from the source data, however I want to o it this way as I have a number of graphs in an array where I want to set the MinimumScale and MaximumScale property based on the points in the chart. The source data is not the same for each worksheet

Regards

Joe
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Get Max & Min from a chart series

Hi Joe,

Try this code, watch the text wrapping.

Sub x()
MsgBox GetChartMax(ActiveChart, 1)
MsgBox GetChartMin(ActiveChart, 1)
End Sub
Function GetChartMax(MyChart As Chart, SeriesIndex As Integer) As Double
GetChartMax =
Application.WorksheetFunction.Max(MyChart.SeriesCo llection(SeriesIndex).Values)
End Function
Function GetChartMin(MyChart As Chart, SeriesIndex As Integer) As Double
GetChartMin =
Application.WorksheetFunction.Min(MyChart.SeriesCo llection(SeriesIndex).Values)
End Function


Cheers
Andy

Joe wrote:

How do you return the Max and Min value of a series on a chart? Assume there there is only 1 series plotted across a time variable.

The logical way is to calc this from the source data, however I want to o it this way as I have a number of graphs in an array where I want to set the MinimumScale and MaximumScale property based on the points in the chart. The source data is not the same for each worksheet.

Regards,

Joe


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel chart maximum series should more than 255 series kameking Charts and Charting in Excel 5 August 22nd 10 10:52 AM
User Selectable Series and Number of Series for Line Chart Dave in NJ Charts and Charting in Excel 2 February 23rd 09 12:18 AM
how to plot column chart with one series against multiple series. svenkateshmurthy Charts and Charting in Excel 2 October 16th 07 09:09 PM
chart data series -- plot a table as a single series hjc Charts and Charting in Excel 7 September 20th 05 05:52 PM
Can I add an average series to a chart with 2 or more series? Yaniv Charts and Charting in Excel 4 June 16th 05 11:37 PM


All times are GMT +1. The time now is 04:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"