How to Link Excel Chart Axis Minimum and Maximum to Cell Formulas
Question details
The user wants to dynamically link the vertical-axis minimum and maximum scale values of an Excel chart directly to values calculated by worksheet formulas.

- Product
- Microsoft Excel
- Device & OS
- Windows, Mac
- Scenario
- Creating dynamic charts where the vertical axis automatically scales to specific calculated boundaries based on shifting data points.
- Observed behavior
- Excel does not offer a standard built-in chart option to link the vertical axis bounds to a cell formula directly. The values must either be manually typed or controlled dynamically using VBA code.
Verify that you are using a desktop version of Excel (Windows or Mac), as VBA macros are required to fully automate dynamic axis limits and are not supported in Excel for the Web.
Use VBA to Dynamically Link Chart Axis Bounds to Cell Formulas
This automated approach utilizes a VBA macro to read your calculated minimum and maximum values from specific worksheet cells and applies them to the chart's axis properties.
Because Excel lacks a native interface feature for dynamic axis bounds, VBA is required to bridge the gap. By assigning a worksheet calculation to the chart's MinimumScale and MaximumScale properties, your chart can adapt to data changes.
Please note that this method requires macros to be enabled in your workbook.
In your worksheet, calculate the desired minimum and maximum limits for your chart axis and place them in dedicated cells (for example, cell A1 for the minimum and A2 for the maximum).
Press Alt + F11 on your keyboard to open the Visual Basic for Applications (VBA) editor.
In the Project Explorer pane on the left, right-click your workbook name, select 'Insert', and choose 'Module'.
In the module window, define a macro that targets your chart. For example, use the ActiveSheet.ChartObjects collection and set .Axes(xlValue).MinimumScale = Range("A1").Value and .Axes(xlValue).MaximumScale = Range("A2").Value.
Run the macro from the Developer tab to update the chart. For fully automatic updates, call this code from a Worksheet_Calculate event in the specific sheet's VBA code module.

Manually Update Chart Axis Min and Max Bounds
If you are using Excel for the Web or prefer a strict no-code approach, you must manually enter your calculated boundaries into the axis formatting settings.
Need a Powerful Yet Lightweight Tool for Advanced Spreadsheets?
While complex spreadsheet manipulations sometimes require extensive workarounds or VBA code, WPS Office offers an incredibly fast, lightweight, and free alternative for all your data analysis and visualization needs. With highly compatible advanced charting tools and full support for traditional spreadsheet formulas, WPS Spreadsheets handles your data beautifully.
- 1. Download WPS Office: Visit the official WPS website to download and install the free, lightweight suite.
- 2. Open Your Spreadsheets: Seamlessly open your existing Excel workbooks in WPS Spreadsheets without losing formatting.
- 3. Visualize Your Data: Highlight your data and use the intuitive tools on the Insert tab to create rich, customizable charts.

Frequently Asked Questions
Can I link the chart axis bounds to cells dynamically in Excel for the Web?
No. Excel for the Web does not support VBA macros, which are required to dynamically link axis bounds to cell values. You must manually type the bounds in the web version or switch to the desktop application to run macros.
How do I make the VBA macro update the chart axis automatically when data changes?
You can place your VBA axis-updating code inside a 'Worksheet_Calculate' or 'Worksheet_Change' event within the specific sheet's VBA module. This ensures the chart axis refreshes automatically the moment the underlying formula calculates new values.
Will the chart axis still auto-scale if I decide to stop using VBA?
Yes. You can restore automatic scaling either by manually clearing the specific values in the 'Format Axis' pane and pressing Enter to reset to 'Auto', or by executing a VBA line that sets .MinimumScaleIsAuto = True and .MaximumScaleIsAuto = True.




