Function FirstWkDayMonth(dayofweek As Integer, dayofmonth As Integer, testdayofweek As Integer) As Integer ' checks to see if the day passed is the first specific weekday of the month ' return 1 for true, return 0 for false FirstWkDayMonth = 0 ' start out with false If (dayofweek = testdayofweek) Then ' match on day, check if less than 8 days into month If (dayofmonth < 8) Then ' match, this has to be the first one FirstWkDayMonth = 1 End If End If Exit Function End Function