Public Function HDBroj(ByVal inTekst As String) As String
Dim varInput_Value As Variant
Dim varResult As Variant
HDBroj = ""
If inTekst = "" Then Exit Function
ObradiSerBroj inTekst
If Not IsNumeric(inTekst) Then Exit Function
varInput_Value = CDec(inTekst)
varResult = CDec(varInput_Value)
varResult = Round(varResult, 2)
varResult = Round(varResult)
HDBroj = CStr(varResult)
If Len(HDBroj) = 1 Then
HDBroj = "0" & HDBroj
End If
End Function
Function ObradiSerBroj(ByRef inTekst As String)
Dim Slova
Dim Vrednosti
Dim intBrojac As Integer
Dim intBrojac2 As Integer
Dim strTMP As String
inTekst = UCase(inTekst)
strTMP = ""
Slova = Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", _
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", _
"K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", _
"U", "V", "W", "X", "Y", "Z")
Vrednosti = Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", _
"10", "11", "12", "13", "14", "15", "16", "17", "18", "19", _
"20", "21", "22", "23", "24", "25", "26", "27", "28", "29", _
"30", "31", "32", "33", "34", "35")
For intBrojac = 1 To Len(inTekst)
For intBrojac2 = 0 To UBound(Slova)
If Mid(inTekst, intBrojac, 1) = Slova(intBrojac2) Then
strTMP = strTMP & Vrednosti(intBrojac2)
End If
Next
Next
inTekst = strTMP
End Function