- Excel for mac line chart add secondary axis update#
- Excel for mac line chart add secondary axis portable#
ValueOrCategory As String, PrimaryOrSecondary As String, Value As Variant)ĭim valueAsText As String 'Set the chart to be controlled by the function Set cht = .Sheets(sheetName) _ Function setChartAxis(sheetName As String, chartName As String, MinOrMax As String, _ Here is the VBA code to copy into the Module. The code for UDFs must be within a standard module to work. The Visual Basic Editor window will open, click Insert -> ModuleĪdd the code below to the Module as shown. To create the UDF click Developer -> Visual Basic (or shortcut ALT + F11). Right-click on a blank part of the ribbon and select Customize the Ribbon… from the menuįrom the Excel Options window click Customize Ribbon, enable the Developer option then click OK.
Excel for mac line chart add secondary axis update#
Whether these values are typed in the cell or created using formulas, they will update the chart. The values in the cell are automatically applied to the chart. The animated gif below shows the solution in action. Thankfully, the minimum and maximum values of the chart axis are controllable using a UDF. For example, it is possible to change a worksheet’s tab color, or to change a chart title (next week’s post). Whether on purpose or by accident, Microsoft have made it possible to control various objects with UDFs. UDF’s are intended to be custom worksheet functions to calculate a cell value. User Defined Functions (UDFs for short) are just like normal Excel functions, such as VLOOKUP or SUM, but they have been created using VBA.
Excel for mac line chart add secondary axis portable#
![excel for mac line chart add secondary axis excel for mac line chart add secondary axis](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/08/final-secondary-axis-1024x452.png)
There are various chart objects we can link to worksheet cells source data, chart titles and data labels can all be linked to cells, but the chart axis is set by hardcoding a number into the Format Axis options window.
![excel for mac line chart add secondary axis excel for mac line chart add secondary axis](https://www.excel-easy.com/examples/images/combination-chart/combination-chart.png)
It only takes a few seconds, but all that time starts to add up. It’s such a tedious task, and I know I’ll be doing it again at a future point. “ Not again…” I think to myself every time I change the minimum and maximum values of a chart axis.