jennypretty
03-11-2010, 03:39 PM
Hello,
I modified a function Null To Zero that I found on the Internet to format a number. But it keeps showing syntax error right at Function.
Function NZ(tData)
If LEN(tData) = 0 Then
NZ = cdbl(0)
Else
On error resume next
tData = cdbl(tData)
If Not IsNumeric(tData) Then tData = 0
NZ = cdbl(tData)
End If
FormatNumber(NZ(total),2)
What did I do wrong?
Thanks.
I modified a function Null To Zero that I found on the Internet to format a number. But it keeps showing syntax error right at Function.
Function NZ(tData)
If LEN(tData) = 0 Then
NZ = cdbl(0)
Else
On error resume next
tData = cdbl(tData)
If Not IsNumeric(tData) Then tData = 0
NZ = cdbl(tData)
End If
FormatNumber(NZ(total),2)
What did I do wrong?
Thanks.