Originally Posted by
Slicemahn
So here is my code attempting to use my UDF to provide a narrative for an Executive summary for occupancy levels in a call centre. I have tried using the suggestions from the vbaexp community, only to have VAL# errors returned.
[vba]Public Function occExtHour(inExtHr As Date) As String
Dim retStr As String
retStr = "4) "
If (inExtHr = 0) Then
retStr = retStr & "No extended hours used "
Else
'retStr = retStr & Format(inExtHr, "HH:MM") & " extended hours filled"
retStr = retStr & Format(inExtHr, "hh:nn") & " extended hours filled"
End If
retStr = retStr & " to cover any intervals over forecast."
occExtHour = retStr
End Function
[/vba]