Chart & Visualization Issues

How to Link Excel Chart Axis Minimum and Maximum to Cell Formulas

John WilsonJohn Wilson Nov 10, 2026 869 views

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.

How to Link Excel Chart Axis Minimum and Maximum to Cell 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.
Before you start

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.

Solution 1Recommended

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.

1
Set Up Cell Calculations

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).

2
Open the VBA Editor

Press Alt + F11 on your keyboard to open the Visual Basic for Applications (VBA) editor.

3
Insert a New Module

In the Project Explorer pane on the left, right-click your workbook name, select 'Insert', and choose 'Module'.

4
Write the VBA Code

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.

5
Run or Trigger the Macro

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.

Use VBA to Dynamically Link Chart Axis Bounds to Cell Formulas
Save as Macro-Enabled Workbook: To ensure your VBA script is not lost, remember to go to File > Save As and save your document as an Excel Macro-Enabled Workbook (.xlsm).
Free Microsoft Office alternative

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. 1. Download WPS Office: Visit the official WPS website to download and install the free, lightweight suite.
  2. 2. Open Your Spreadsheets: Seamlessly open your existing Excel workbooks in WPS Spreadsheets without losing formatting.
  3. 3. Visualize Your Data: Highlight your data and use the intuitive tools on the Insert tab to create rich, customizable charts.
Free, lightweight, and user-friendly spreadsheet software.Highly compatible with Microsoft Excel formats, including .xlsx, .xls, and .xlsm.Robust charting and data visualization tools to clearly communicate your data.Familiar tabbed user interface ensuring seamless migration without a steep learning curve.
microsoft office alternative - wps office

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.