如果传递的值“DateValue”为空,我的以下代码返回“00:00:00”
vba:
Public Function forDate(ByVal DateValue As String) As Date
Dim DoDate As Date
If Not IsNull(DateValue) And DateValue <> "" Then
DoDate = CDate(FormatDateTime(DateValue, 1, 10))
forDate = DoDate
End If
End Function
“DateValue”为空时如何处理???请提出一个答案。