I'm currently working on a huge Gantt Chart with over 100 activities. Each activity needs a quantity of resources (mechanics). The excel sheet that I have is automatic, where the chart colors green the cells from starting date to end date automatically with a conditional formatting. If I change a starting date or end date, the gantt chart adjusts itself. I wanted to implement a function that if the cells of dates are colored green, then it sums the resources of that activity and allocates the quantity of resources needed for that activity on those days. This way, if I edit the dates of an activity, the cells colored green (duration) will adjust itself but along with the resources needed for that day.

If I'm not mistaken a new function has to be created with VBA. For example, the function would basicallly be as SUMIF (IF the cell is green, Then sum these values and include them in that green cell).