My understanding is that a Function returns a value, i.e. a number or a string. I'm not aware it returns a format as well. Hence there seems little point in including a format in the function.
And in any case you presumably want a proper date number returned to excel. In which case I'd be onclined to format the cells in Excel first. Then the function is
Function LastDay(DateUsed As Date) As Date
LastDay = WorksheetFunction.EoMonth(DateUsed, 0)
End Function
and in a procedure
Range("F13") = "=LastDay(d6)"
Bookmarks