Thread: Friday
View Single Post
  #2   Report Post  
Jim Cone
 
Posts: n/a
Default Friday

Winston,
'-----------
Function GetFriday(ByRef dteEntry As Date) As String
Dim lngN As Long
lngN = Weekday(dteEntry)
If lngN < vbFriday Then
GetFriday = "The most recent Friday was " & Date - lngN - 1
Else
GetFriday = "The date entry is a Friday " & dteEntry
End If
End Function

'Call function
Sub FindTheFriday()
MsgBox GetFriday(Date) & " "
End Sub
'-----------
Jim Cone
San Francisco, USA



"Winston" wrote...
Hi
How do I calculate the following problem
If today does not equal friday then go back to last friday.
Can anyone HELP?
Regards
Winston