Retrieving the first sunday date

T

tanhus

Dim firstSunday As Date
firstSunday = FormatDateTime(#1/1/2006#)

i want to retrive the first sunday of the current year and put that in the
expression in the code up top, instead of writing in the exact expression
for this year (like how i did).
 
K

Klatuu

Dim firstSunday As Date

firstSunday = DateSerial(Year(Date) ,1 ,1)
firstSunday = DateAdd("d",vbSunday - DatePart("w",firstSunday),
firstSunday)
if Year(firstSunday) < Year(Date) Then
firstSunday = DateAdd("ww", 1, firstSunday)
End If
 
Top