jbenfleming
New Member
- Joined
- Mar 30, 2017
- Messages
- 34
I have worksheet function I made, Days90(). Its purpose is to output the date that is 90 days from the current day, not including weekends. Everything with it works except it is output as a serial instead of as a date. For example, if I use the function today it will output 43311 instead of 7/30/2018. Code:
I thought that the formatting of the result would show up on the worksheet. Any ideas?
Code:
Public Function Days90() As Date
Days90 = Date
If VBA.Format(Days90 + 90, "dddd") = "Saturday" Then
Days90 = VBA.Format(Days90 + 92, "Short Date")
ElseIf VBA.Format(Date + 90, "dddd") = "Sunday" Then
Days90 = VBA.Format(Days90 + 91, "Short Date")
Else
Days90 = VBA.Format(Days90 + 90, "Short Date")
End If
End Function
I thought that the formatting of the result would show up on the worksheet. Any ideas?
Last edited: