Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following function that I use to adjust the scale on my y-axis.
My sheet has around 12 charts that are updated, but sometimes they might not contain data causing the macro to holt on the GetChartMin Function. How can I Skip the yAxis loop when GetChartMin cannot be determined. Regards, Bruce Private Function yAxis() arrChart = Array("Summary") For Each a In arrChart For Each Chart In Sheets(a).ChartObjects() Chart.Activate High = GetChartMax(ActiveChart, 1) * 1.01 low = GetChartMin(ActiveChart, 1) * 0.995 ActiveChart.Axes(xlValue).Select With ActiveChart.Axes(xlValue) .MinimumScale = low .MaximumScale = High .MinorUnitIsAuto = True .MajorUnitIsAuto = True .Crosses = xlCustom .CrossesAt = 0 .ReversePlotOrder = False .ScaleType = xlLinear .DisplayUnit = xlNone End With Next Chart Next a Range("A1").Select End Function Private Function GetChartMax(MyChart As Chart, SeriesIndex As Integer) As Double GetChartMax = Application.WorksheetFunction.Max(MyChart.SeriesCo llection(SeriesIndex).Values) End Function Private Function GetChartMin(MyChart As Chart, SeriesIndex As Integer) As Double GetChartMin = Application.WorksheetFunction.Min(MyChart.SeriesCo llection(SeriesIndex).Values) End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
SUM determined by drop-down list | Excel Worksheet Functions | |||
how are random numbers determined | Excel Worksheet Functions | |||
tabbing in a pre-determined direction | Excel Discussion (Misc queries) | |||
how do i use the function to copy and paste a determined variable. | Excel Worksheet Functions | |||
Determined to eliminate .select | Excel Programming |