Option Explicit
Function ZeroCount(r As Range) As Long
Dim sStr As String, n
ZeroCount = 0
n = CDec(r.Text)
If InStr(1, n, Application.DecimalSeparator) = 0 Then Exit Function
sStr = Split(n, Application.DecimalSeparator)(1)
While Left$(sStr, 1) = "0"
sStr = Right$(sStr, Len(sStr) - 1)
ZeroCount = ZeroCount + 1
Wend
End Function