Public Function Converter(Conv1)
20 If i = 0 Then
Converter = z
GoTo 175
End If
If i = 1 Then GoTo
100
If i = 2 Then GoTo
200
If i = 3 Then GoTo
300
If i = 4 Then GoTo
400
If i = 5 Then GoTo
200
If i = 6 Then GoTo
300
If i = 7 Then GoTo
100
If i = 8 Then GoTo
200
If i = 9 Then GoTo
300
If i = 10 Then GoTo
100
If i = 11 Then GoTo
200
300 If Mid(k, s - i + 1, 1) = 1 Then z
= z + " сто"
If Mid(k, s - i + 1,
1) = 2 Then z = z + " двести"
If Mid(k, s - i + 1,
1) = 3 Then z = z + " триста"
If Mid(k, s - i + 1,
1) = 4 Then z = z + " четыреста"
If Mid(k, s - i + 1,
1) = 5 Then z = z + " пятьсот"
If Mid(k, s - i + 1,
1) = 6 Then z = z + " шестьсот"
If Mid(k, s - i + 1,
1) = 7 Then z = z + " семьсот"
If Mid(k, s - i + 1,
1) = 8 Then z = z + " восемьсот"
If Mid(k, s - i + 1,
1) = 9 Then z = z + " девятьсот"
i = i - 1
GoTo 20
200 If Mid(k, s - i + 1, 1) = 1 Then
GoTo 500
If Mid(k, s - i + 1,
1) = 2 Then z = z + " двадцать"
If Mid(k, s - i + 1,
1) = 3 Then z = z + " тридцать"
If Mid(k, s - i + 1,
1) = 4 Then z = z + " сорок"
If Mid(k, s - i + 1,
1) = 5 Then z = z + " пятьдесят"
If Mid(k, s - i + 1,
1) = 6 Then z = z + " шестьдесят"
If Mid(k, s - i + 1,
1) = 7 Then z = z + " семьдесят"
If Mid(k, s - i + 1,
1) = 8 Then z = z + " восемьдесят"
If Mid(k, s - i + 1,
1) = 9 Then z = z + " девяносто"
i = i - 1
GoTo 20
100 If Mid(k, s - i + 1, 1) = 1 Then z
= z + " один"
If Mid(k, s - i + 1,
1) = 2 Then z = z + " два"
If Mid(k, s - i + 1,
1) = 3 Then z = z + " три"
If Mid(k, s - i + 1,
1) = 4 Then z = z + " четыре"
If Mid(k, s - i + 1,
1) = 5 Then z = z + " пять"
If Mid(k, s - i + 1,
1) = 6 Then z = z + " шесть"
If Mid(k, s - i + 1,
1) = 7 Then z = z + " семь"
If Mid(k, s - i + 1,
1) = 8 Then z = z + " восемь"
If Mid(k, s - i + 1,
1) = 9 Then z = z + " девять"
If i = 1 Then GoTo
701
If i = 7 Then GoTo
702
If i = 10 Then GoTo
703
400 If Mid(k, s - i + 1, 1) = 1 Then z
= z + " одна"
If Mid(k, s - i + 1,
1) = 2 Then z = z + " две"
If Mid(k, s - i + 1,
1) = 3 Then z = z + " три"
If Mid(k, s - i + 1,
1) = 4 Then z = z + " четыре"
If Mid(k, s - i + 1,
1) = 5 Then z = z + " пять"
If Mid(k, s - i + 1,
1) = 6 Then z = z + " шесть"
If Mid(k, s - i + 1,
1) = 7 Then z = z + " семь"
If Mid(k, s - i + 1,
1) = 8 Then z = z + " восемь"
If Mid(k, s - i + 1,
1) = 9 Then z = z + " девять"
If i = 4 Then GoTo
704
GoTo 20
500 If Mid(k, s - i + 1, 2) = 11
Then z = z + " одиннадцать"
If Mid(k, s - i + 1,
2) = 12 Then z = z + " двенадцать"
If Mid(k, s - i + 1,
2) = 13 Then z = z + " тринадцать"
If Mid(k, s - i + 1,
2) = 14 Then z = z + " четырнадцать"
If Mid(k, s - i + 1,
2) = 15 Then z = z + " пятнадцать"
If Mid(k, s - i + 1,
2) = 16 Then z = z + " шестнадцать"
If Mid(k, s - i + 1,
2) = 17 Then z = z + " семнадцать"
If Mid(k, s - i + 1,
2) = 18 Then z = z + " восемнадцать"
If Mid(k, s - i + 1,
2) = 19 Then z = z + " девятнадцать"
If Mid(k, s - i + 1,
2) = 10 Then z = z + " десять"
If i = 5 Then z = z
+ " тысяч"
If i = 8 Then z = z
+ " миллионов"
If i = 11 Then z = z
+ " миллиардов"
If i = 2 Then
z = z + " рублей"
If InStr(k, ",") > 0 Then GoTo 600
End If
i = i - 2
GoTo 20
70 If Mid(k, s - i + 1, 1) = 1
Then z = z + " Сто"
If Mid(k, s - i + 1,
1) = 2 Then z = z + " Двести"
If Mid(k, s - i + 1,
1) = 3 Then z = z + " Триста"
If Mid(k, s - i + 1,
1) = 4 Then z = z + " Четыреста"
If Mid(k, s - i + 1,
1) = 5 Then z = z + " Пятьсот"
If Mid(k, s - i + 1,
1) = 6 Then z = z + " Шестьсот"
If Mid(k, s - i + 1,
1) = 7 Then z = z + " Семьсот"
If Mid(k, s - i + 1,
1) = 8 Then z = z + " Восемьсот"
If Mid(k, s - i + 1,
1) = 9 Then z = z + " Девятьсот"
i = i - 1
GoTo 20
60 If Mid(k, s - i + 1, 1) = 1
Then GoTo 90
If Mid(k, s - i + 1,
1) = 2 Then z = z + " Двадцать"
If Mid(k, s - i + 1,
1) = 3 Then z = z + " Тридцать"
If Mid(k, s - i + 1,
1) = 4 Then z = z + " Сорок"
If Mid(k, s - i + 1,
1) = 5 Then z = z + " Пятьдесят"
If Mid(k, s - i + 1,
1) = 6 Then z = z + " Шестьдесят"
If Mid(k, s - i + 1,
1) = 7 Then z = z + " Семьдесят"
If Mid(k, s - i + 1,
1) = 8 Then z = z + " Восемьдесят"
If Mid(k, s - i + 1,
1) = 9 Then z = z + " Девяносто"
i = i - 1
GoTo 20
50 If Mid(k, s - i + 1, 1) = 1
Then z = z + " Один"
If Mid(k, s - i + 1,
1) = 2 Then z = z + " Два"
If Mid(k, s - i + 1,
1) = 3 Then z = z + " Три"
If Mid(k, s - i + 1,
1) = 4 Then z = z + " Четыре"
If Mid(k, s - i + 1,
1) = 5 Then z = z + " Пять"
If Mid(k, s - i + 1,
1) = 6 Then z = z + " Шесть"
If Mid(k, s - i + 1,
1) = 7 Then z = z + " Семь"
If Mid(k, s - i + 1,
1) = 8 Then z = z + " Восемь"
If Mid(k, s - i + 1,
1) = 9 Then z = z + " Девять"
If i = 1 Then GoTo
701
If i = 7 Then GoTo
702
If i = 10 Then GoTo
703
80 If Mid(k, s - i + 1, 1) = 1
Then z = z + " Одна"
If Mid(k, s - i + 1,
1) = 2 Then z = z + " Две"
If Mid(k, s - i + 1,
1) = 3 Then z = z + " Три"
If Mid(k, s - i + 1,
1) = 4 Then z = z + " Четыре"
If Mid(k, s - i + 1,
1) = 5 Then z = z + " Пять"
If Mid(k, s - i + 1,
1) = 6 Then z = z + " Шесть"
If Mid(k, s - i + 1,
1) = 7 Then z = z + " Семь"
If Mid(k, s - i + 1,
1) = 8 Then z = z + " Восемь"
If Mid(k, s - i + 1,
1) = 9 Then z = z + " Девять"
If i = 4 Then GoTo
704
GoTo 20
90 If Mid(k, s - i + 1, 2) =
11 Then z = z + " Одиннадцать"
If Mid(k, s - i + 1,
2) = 12 Then z = z + " Двенадцать"
If Mid(k, s - i + 1,
2) = 13 Then z = z + " Тринадцать"
If Mid(k, s - i + 1,
2) = 14 Then z = z + " Четырнадцать"
If Mid(k, s - i + 1,
2) = 15 Then z = z + " Пятнадцать"
If Mid(k, s - i + 1,
2) = 16 Then z = z + " Шестнадцать"
If Mid(k, s - i + 1,
2) = 17 Then z = z + " Семнадцать"
If Mid(k, s - i + 1,
2) = 18 Then z = z + " Восемнадцать"
If Mid(k, s - i + 1,
2) = 19 Then z = z + " Девятнадцать"
If Mid(k, s - i + 1,
2) = 10 Then z = z + " Десять"
If i = 5 Then z = z
+ " тысяч"
If i = 8 Then z = z
+ " миллионов"
If i = 11 Then z = z
+ " миллиардов"
If i = 2 Then
z = z + " рублей"
If InStr(k, ",") > 0 Then GoTo 600
End If
i = i - 2
GoTo 20
600 z = z + " " + Right(k, 2)
If Right(k, 1) = 2
Then z = z + " копейки"
If Right(k, 1) = 3
Then z = z + " копейки"
If Right(k, 1) = 4
Then z = z + " копейки"
If Right(k, 1) = 1
Then z = z + " копейкa"
If Right(k, 1) = 0
Then z = z + " копеек"
If Right(k, 1) >
4 Then z = z + " копеек"
Converter = z
Exit Function
701 If Mid(k, s - i + 1, 1) = 2 Then z
= z + " рубля"
If Mid(k, s - i + 1,
1) = 3 Then z = z + " рубля"
If Mid(k, s - i + 1,
1) = 4 Then z = z + " рубля"
If Mid(k, s - i + 1,
1) = 1 Then z = z + " рубль"
If Mid(k, s - i + 1,
1) > 4 Then z = z + " рублей"
If Left(k, s) = 0
Then
If InStr(k, ",") > 0 Then
z = z + "Ноль рублей"
GoTo 600
End If
If InStr(k, ",") = 0 Then Exit Function
End If
If Mid(k, s - i + 1,
1) = 0 Then z = z + " рублей"
If InStr(k,
",") > 0 Then GoTo 600
Converter = z
Exit Function
702 If Mid(k, s - i + 1, 1) = 2 Then
z = z + " миллиона"
If Mid(k, s - i + 1,
1) = 3 Then z = z + " миллиона"
If Mid(k, s - i + 1,
1) = 4 Then z = z + " миллиона"
If Mid(k, s - i + 1,
1) = 1 Then z = z + " миллион"
If Mid(k, s - i + 1,
1) > 4 Then z = z + " миллионов"
If Mid(k, s - i + 1,
1) = 0 Then
If n(7) + n(8) + n(9) > 0 Then z = z + " миллионов"
End If
i = i - 1
GoTo 20
703 If Mid(k, s - i + 1, 1) = 2 Then z
= z + " миллиарда"
If Mid(k, s - i + 1,
1) = 3 Then z = z + " миллиарда"
If Mid(k, s - i + 1,
1) = 4 Then z = z + " миллиарда"
If Mid(k, s - i + 1,
1) = 1 Then z = z + " миллиард"
If Mid(k, s - i + 1,
1) > 4 Then z = z + " миллиардов"
If Mid(k, s - i + 1,
1) = 0 Then
If n(10) + n(11) + n(12) > 0 Then z = z + " миллиардов"
End If
i = i - 1
GoTo 20
704 If Mid(k, s - i + 1, 1) = 2 Then z
= z + " тысячи"
If Mid(k, s - i + 1,
1) = 3 Then z = z + " тысячи"
If Mid(k, s - i + 1,
1) = 4 Then z = z + " тысячи"
If Mid(k, s - i + 1,
1) = 1 Then z = z + " тысяча"
If Mid(k, s - i + 1,
1) > 4 Then z = z + " тысяч"
If Mid(k, s - i + 1,
1) = 0 Then
If n(4) + n(5) + n(6) > 0 Then z = z + " тысяч"
End If
i = i - 1
GoTo 20
ErrorInput:
If
MsgBox("Неправильный формат введенной суммы",
vbCritical, "Ошибка формата") = vbOK Then Exit Function
175 End Function