simplest one try this

[VBA]Public Function Calc(AccountNo As Variant)
Calc = Len(AccountNo)
End Function
[/VBA]


i dont know why u are defining as string