Can anyone tell me what is wrong with this?
I am trying to get the date of Last sunday
Function getLastSunday()
Dim dDate As String
dDate = Format(Date, "dddd")
Do Until Format(dDate, "dddd") = "Sunday"
dDate = Date - 1
Loop
getLastSunday = dDate
End Function
Help appreciated
KISS - Keep It Simple Sugar!
I am trying to get the date of Last sunday
Function getLastSunday()
Dim dDate As String
dDate = Format(Date, "dddd")
Do Until Format(dDate, "dddd") = "Sunday"
dDate = Date - 1
Loop
getLastSunday = dDate
End Function
Help appreciated
KISS - Keep It Simple Sugar!