I have a vba automation to concatenate some text but it's been giving me the "Overflow" error when changing the result to date in this specific file (works fine in others).
Function FormatAsDate(value As Variant, isDateColumn As Boolean) As String
' Format the value as a date if it's a valid date or a date serial number
If isDateColumn And IsNumeric(value) Then
** FormatAsDate = Format(CDbl(value), "mm/dd/yyyy")**
Else
FormatAsDate = CStr(value)
End If
End Function
I've tried to use less rows (down to 10 rows) and nothing. Could it be hidden formatting in my file? Please help!
value?? format(10052026,"mm/dd/yyyy")in the Immediate window also gives "overflow"