Automatically update x-axis values at year end

Copper Contributor

I have a Gantt chart. The x-axis minimum and maximum bounds are currently 45292 and 45657, signifying 01/01/2024 and 12/31/2024 respectively. These minimum and maximum numbers are driven by a 'Date' field where the user enters the date. The functions are: =DATE(YEAR(Data!$B$4), 1, 1) & =DATE(YEAR(Data!$B$4), 12, 31). When the year switches from 2024 to 2025, I want it to trigger a macro that updates the minimum and maximum bounds of the x-axis. YouTube videos and ChatGPT are not helping. 

 

Thank you. 

1 Reply
What exactly did you ask ChatGPT? instead of tweaking the x-axis of a chart, you should tweak the underlying data for x-axis instead. e.g. you can ask ChatGPT: "how to write a script to update the dates in row 4 of an excel sheet to the current date if they reach year end?"