Code:Public Function Broj(StrBroj) As Double
'*******************************************
'*Ime:Broj (Function)
'*Sadržaj:Pretvara string u broj
'*Autor: ZXZ
'*Datum: 06 03, 2013, 05:17:27
'*Adresa: Tuzla BiH
'*Email:
[email protected]
'*Ulazni parametri:Broj kao string
'*Vraća vrijednost:Broj
'*******************************************
Dim I As Integer, Duz As Integer
Dim Temp As String, Znak As String * 1
On Error GoTo ErrHandler
Duz = Len(StrBroj)
For I = 1 To Duz
Znak = Mid(StrBroj, I, 1)
If Znak <> "," Then
Temp = Temp & Znak
End If
Next I
Broj = Val(Temp)
ExitHere:
Exit Function
ErrHandler:
Dim strErrString As String
strErrString = "Error Information..." & vbCrLf
strErrString = strErrString & "Error#: " & Err.Number
strErrString = strErrString & "Description: " & Err.Description
MsgBox strErrString, vbCritical + vbOKOnly, "Function: Broj"
Resume ExitHere
End Function
zxz