Function dow(m As Integer,d As Integer,y As Integer) As Integer ' 1 2 3 4 5 6 7 ' sun mon tue wed the fri sat If m < 3 Then m=m + 12 y=y-1 End If dow = 1 + (d + ((26 * m+1)/10) - (2 * (y\100)) + y + (y\4) + (y\400) ) Mod 7 End Function