Try this version, attached
All I modified was the days in row 5 and the formulas in row 6 and changed some formatting and conditional formatting to get the right shading for weekends and days not in that month. Now it should work as you want. I tested it for several months and I don't see any problems.....
regards, barry