lior03
08-01-2005, 12:40 PM
hello
the following formula return the first sunday of the month.
=DATE(YEAR($B$18),MONTH($B$18),1)+ MOD(1+7-WEEKDAY(DATE(YEAR($B$18),MONTH($B$18),1)),7)
how can i turn it into a vba udf.
maybe:
Function dado(d As Date)
dado = DateSerial(year(d), month(d), 1) + Application.WorksheetFunction.MOD _
(1 + 7 - Application.WorksheetFunction.Weekday(DateSerial(year(d), month(d), 1)), 7)
End Function
whats wrong
thanks
the following formula return the first sunday of the month.
=DATE(YEAR($B$18),MONTH($B$18),1)+ MOD(1+7-WEEKDAY(DATE(YEAR($B$18),MONTH($B$18),1)),7)
how can i turn it into a vba udf.
maybe:
Function dado(d As Date)
dado = DateSerial(year(d), month(d), 1) + Application.WorksheetFunction.MOD _
(1 + 7 - Application.WorksheetFunction.Weekday(DateSerial(year(d), month(d), 1)), 7)
End Function
whats wrong
thanks