Here is a riutine that can check whether a date is a valid instance, say the 1st Monday, 2nd Thursday, etc, and if the month is a quarter month
Function DateInstance(pzDate, pzDow As Long, pzInstance As Long, _
Optional pzQuarter As Boolean = False) As Boolean
Dim dteCheck As Date
Dim fValid As Boolean
fValid = DateSerial(Year(pzDate), Month(pzDate), 1 + 7 * pzInstance) - _
Weekday(DateSerial(Year(pzDate), Month(pzDate), 8 - pzDow)) = _
pzDate
If fValid Then
If pzQuarter Then
fValid = Month(pzDate) Mod 3 = 0
End If
End If
DateInstance = fValid
End Function
You would use it like
?DateInstance(DateSerial(2005,07,20),4,3)
will check if 20-Jul is the 3rd Wed (day number 4) of the month
?DateInstance(DateSerial(2005,06,20),4,2,True)
will check if 20-Jun is the 4th Tue (day number 2) of the month, and the month is a quarter month