It creates it using the year in cell E17 and the month in cell E17. When you have a valid date in Excel you and just add days directly. Here are some simple VBA macro code examples that add or subtract days to the active selected cell.
When day is less than 1 this function will subtract the value of the number of days plus one from the first day of the month specified.
If you need to add or subtract business days workdays to a date so that you can calculate a date in the future or past that skips weekends and holidays you can use the WORKDAY function. The DATE function then combines these three values into a date that is 1 year 7 months and. It creates it using the year in cell E17 and the month in cell E17. With the target date in B3 and the number of days in B4 the formula is as simple as adding up two cells.