Waterfall Chart - Dynamic Axis Start

EasterGreen

Board Regular
Joined
Sep 7, 2009
Messages
50
I have a waterfall chart in a report that has different departments' data fed in to it and each has significantly different spends.
For larger departments the total "start" and "end" columns are quite tall and force the chart axis to be large numbers.
Any minor bars showing small movements between start and end are hard to interpret.
Is there any way to dynamically change the Y axis minimum from zero to x such that I can set a formula to define the start point?
Image 1 is the automatic axis, Image 2 is where I have manually altered the axis start point.
1593600278631.png

1593600286584.png
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
You could use a function like this:

Code:
Function SetMin(MinValue As Double, ChartName As String)
    Application.Caller.Worksheet.ChartObjects(ChartName).Chart.Axes(xlValue).MinimumScale = MinValue
    SetMin = "Set"
End Function

and then call it from a cell on the same sheet as the chart (you'll need to alter it if it's a chart sheet) passing the min value and chart name.
 
Upvote 0
Thanks for your reply. I'm afraid I don't follow it.
My chart is "Chart1" and the minimum value could be in cell D14.
And not sure what call the cell means.
 
Upvote 0
I mean you'd add that code to a normal module in your workbook, then in a cell enter;

=SetMin(D14, "Chart 1")

for example. You could also use an event Like Worksheet_Change and just monitor the cell(s) that you use for the relevant chart values.
 
Upvote 0
I really appreciate the advice but I can't get this to work.
I have entered:
Function SetMin(MinValue As Double, ChartName As String)
Application.Caller.Worksheet.ChartObjects(Chart1).Chart.Axes(xlValue).MinimumScale = MinValue
SetMin = "Set"
End Function

and then in my worksheet typed =SetMin(D14,"Chart1") in cell D15
I get #Value! as the result in D15 and the chart doesn't change.
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,457
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top