05-21-2022, 09:20 PM
Code: (Select All)
Function lDate$
p$ = "th"
If Val(Mid$(Date$, 4, 2)) <= 9 Then
day$ = Right$(Mid$(Date$, 4, 2), 1)
Else
day$ = Mid$(Date$, 4, 2)
End If
If Val(Mid$(Date$, 4, 2)) = 1 Or Val(Mid$(Date$, 4, 2)) = 21 Or Val(Mid$(Date$, 4, 2)) = 31 Then p$ = "st"
If Val(Mid$(Date$, 4, 2)) = 2 Or Val(Mid$(Date$, 4, 2)) = 22 Then p$ = "nd"
If Val(Mid$(Date$, 4, 2)) = 3 Or Val(Mid$(Date$, 4, 2)) = 23 Then p$ = "rd"
Select Case Val(Mid$(Date$, 1, 2))
Case 1: Month$ = "January"
Case 2: Month$ = "February"
Case 3: Month$ = "March"
Case 4: Month$ = "April"
Case 5: Month$ = "May"
Case 6: Month$ = "June"
Case 7: Month$ = "July"
Case 8: Month$ = "August"
Case 9: Month$ = "September"
Case 10: Month$ = "October"
Case 11: Month$ = "November"
Case 12: Month$ = "December"
End Select
lDate = day$ + p$ + " " + Month$ + " " + Mid$(Date$, 7, 4)
End Function