Function howManyDays(ByVal startDate As Date, ByVal endDate As Date, ByVal whichMonth As Integer) As Integer Dim curDate As Date
curDate = startDate howManyDays = 0 If endDate < startDate Then Exit Function Do If Month(curDate) = whichMonth Then howManyDays = howManyDays + 1 curDate = DateAdd("d", 1, curDate) Loop Until curDate > endDate End Function