Function getNextMonthLastTuesday() As Date
' returns date of last tuesday of next month
Dim ret As Date
ret = DateSerial(Year(Date), Month(Date) + 2, 0)
' gets date of last day of next month
daystosubtract = Weekday(ret)
If (daystosubtract >= 3) Then daystosubtract = daystosubtract - 3 Else daystosubtract = daystosubtract + 4
'determines how many days prior to ret that Tuesday occured, will be subtracted from ret
getNextMonthLastTuesday = DateAdd("d", -1 * daystosubtract, ret)
End Function