how to use INDIC LANGUAGE in VBA?

appu_gusai

New Member
Joined
Aug 13, 2012
Messages
35
hello ever 1,

this is my 1st post,

please tell me how to use Indic Gujarati Language in VBA with Excel 2003?

i m need to English Number to Gujarati Text formula, if any one have it give me, thank';s in advance :)

like 120=એક સો વીસ

thank's in advance :)
 
wait for some time, now m done it 99% 1 more issue then finished with GREAT HELP PGC01

last one issue finished, full code i post it here :)

thank's

Can u post code as per now? At least maybe some1 can help you mate.

Biz
 
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Can u post code as per now? At least maybe some1 can help you mate.

Biz

here it is Gujarati final code :)
Code:
''This Function Develop by PGC01 & Design by ::aPPu::
'


Function gwords(amt As Variant) As Variant
Dim FIGURE As Variant
Dim FIGLEN As Integer
Dim i As Integer
Dim WORDs(99) As String
Dim tens(9) As String
WORDs(1) = ChrW(&HA8F) & ChrW(&HA95) & " "
WORDs(2) = ChrW(&HAAC) & ChrW(&HAC7) & " "
WORDs(3) = ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAA3) & " "
WORDs(4) = ChrW(&HA9A) & ChrW(&HABE) & ChrW(&HAB0) & " "
WORDs(5) = ChrW(&HAAA) & ChrW(&HABE) & ChrW(&HA82) & ChrW(&HA9A) & " "
WORDs(6) = ChrW(&HA9B) & " "
WORDs(7) = ChrW(&HAB8) & ChrW(&HABE) & ChrW(&HAA4) & " "
WORDs(8) = ChrW(&HA86) & ChrW(&HAA0) & " "
WORDs(9) = ChrW(&HAA8) & ChrW(&HAB5) & " "
WORDs(10) = ChrW(&HAA6) & ChrW(&HAB8) & " "
WORDs(11) = ChrW(&HA85) & ChrW(&HA97) & ChrW(&HABF) & ChrW(&HAAF) & ChrW(&HABE) & ChrW(&HAB0) & " "
WORDs(12) = ChrW(&HAAC) & ChrW(&HABE) & ChrW(&HAB0) & " "
WORDs(13) = ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
WORDs(14) = ChrW(&HA9A) & ChrW(&HACC) & ChrW(&HAA6) & " "
WORDs(15) = ChrW(&HAAA) & ChrW(&HA82) & ChrW(&HAA6) & ChrW(&HAB0) & " "
WORDs(16) = ChrW(&HAB8) & ChrW(&HACB) & ChrW(&HAB3) & " "
WORDs(17) = ChrW(&HAB8) & ChrW(&HAA4) & ChrW(&HAB0) & " "
WORDs(18) = ChrW(&HA85) & ChrW(&HAA2) & ChrW(&HABE) & ChrW(&HAB0) & " "
WORDs(19) = ChrW(&HA93) & ChrW(&HA97) & ChrW(&HAA3) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(20) = ChrW(&HAB5) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(21) = ChrW(&HA8F) & ChrW(&HA95) & ChrW(&HAB5) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(22) = ChrW(&HAAC) & ChrW(&HABE) & ChrW(&HAB5) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(23) = ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC7) & ChrW(&HAB5) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(24) = ChrW(&HA9A) & ChrW(&HACB) & ChrW(&HAB5) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(25) = ChrW(&HAAA) & ChrW(&HA9A) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(26) = ChrW(&HA9B) & ChrW(&HAB5) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(27) = ChrW(&HAB8) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAA4) & ChrW(&HABE) & ChrW(&HAB5) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(28) = ChrW(&HA85) & ChrW(&HAA0) & ChrW(&HACD) & ChrW(&HAAF) & ChrW(&HABE) & ChrW(&HAB5) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(29) = ChrW(&HA93) & ChrW(&HA97) & ChrW(&HAA3) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(30) = ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(31) = ChrW(&HA8F) & ChrW(&HA95) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(32) = ChrW(&HAAC) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(33) = ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(34) = ChrW(&HA9A) & ChrW(&HACB) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(35) = ChrW(&HAAA) & ChrW(&HABE) & ChrW(&HA82) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(36) = ChrW(&HA9B) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(37) = ChrW(&HAB8) & ChrW(&HABE) & ChrW(&HAA1) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(38) = ChrW(&HA86) & ChrW(&HAA1) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(39) = ChrW(&HA93) & ChrW(&HA97) & ChrW(&HAA3) & ChrW(&HA9A) & ChrW(&HABE) & ChrW(&HAB2) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(40) = ChrW(&HA9A) & ChrW(&HABE) & ChrW(&HAB2) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(41) = ChrW(&HA8F) & ChrW(&HA95) & ChrW(&HAA4) & ChrW(&HABE) & ChrW(&HAB2) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(42) = ChrW(&HAAC) & ChrW(&HAC7) & ChrW(&HAA4) & ChrW(&HABE) & ChrW(&HAB2) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(43) = ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAA4) & ChrW(&HABE) & ChrW(&HAB2) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(44) = ChrW(&HA9A) & ChrW(&HAC1) & ChrW(&HAAE) & ChrW(&HABE) & ChrW(&HAB2) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(45) = ChrW(&HAAA) & ChrW(&HABF) & ChrW(&HAB8) & ChrW(&HACD) & ChrW(&HAA4) & ChrW(&HABE) & ChrW(&HAB2) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(46) = ChrW(&HA9B) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HABE) & ChrW(&HAB2) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(47) = ChrW(&HAB8) & ChrW(&HAA1) & ChrW(&HAA4) & ChrW(&HABE) & ChrW(&HAB2) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(48) = ChrW(&HA85) & ChrW(&HAA1) & ChrW(&HAA4) & ChrW(&HABE) & ChrW(&HAB2) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(49) = ChrW(&HA93) & ChrW(&HA97) & ChrW(&HAA3) & ChrW(&HAAA) & ChrW(&HA9A) & ChrW(&HABE) & ChrW(&HAB8) & " "
WORDs(50) = ChrW(&HAAA) & ChrW(&HA9A) & ChrW(&HABE) & ChrW(&HAB8) & " "
WORDs(51) = ChrW(&HA8F) & ChrW(&HA95) & ChrW(&HABE) & ChrW(&HAB5) & ChrW(&HAA8) & " "
WORDs(52) = ChrW(&HAAC) & ChrW(&HABE) & ChrW(&HAB5) & ChrW(&HAA8) & " "
WORDs(53) = ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC7) & ChrW(&HAAA) & ChrW(&HAA8) & " "
WORDs(54) = ChrW(&HA9A) & ChrW(&HACB) & ChrW(&HAAA) & ChrW(&HAA8) & " "
WORDs(55) = ChrW(&HAAA) & ChrW(&HA82) & ChrW(&HA9A) & ChrW(&HABE) & ChrW(&HAB5) & ChrW(&HAA8) & " "
WORDs(56) = ChrW(&HA9B) & ChrW(&HAAA) & ChrW(&HACD) & ChrW(&HAAA) & ChrW(&HAA8) & " "
WORDs(57) = ChrW(&HAB8) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAA4) & ChrW(&HABE) & ChrW(&HAB5) & ChrW(&HAA8) & " "
WORDs(58) = ChrW(&HA85) & ChrW(&HAA0) & ChrW(&HABE) & ChrW(&HAB5) & ChrW(&HAA8) & " "
WORDs(59) = ChrW(&HA93) & ChrW(&HA97) & ChrW(&HAA3) & ChrW(&HAB8) & ChrW(&HABE) & ChrW(&HA87) & ChrW(&HAA0) & " "
WORDs(60) = ChrW(&HAB8) & ChrW(&HABE) & ChrW(&HA87) & ChrW(&HAA0) & " "
WORDs(61) = ChrW(&HA8F) & ChrW(&HA95) & ChrW(&HAB8) & ChrW(&HAA0) & " "
WORDs(62) = ChrW(&HAAC) & ChrW(&HABE) & ChrW(&HAB8) & ChrW(&HAA0) & " "
WORDs(63) = ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC7) & ChrW(&HAB8) & ChrW(&HAA0) & " "
WORDs(64) = ChrW(&HA9A) & ChrW(&HACB) & ChrW(&HAB8) & ChrW(&HAA0) & " "
WORDs(65) = ChrW(&HAAA) & ChrW(&HABE) & ChrW(&HAB8) & ChrW(&HAA0) & " "
WORDs(66) = ChrW(&HA9B) & ChrW(&HABE) & ChrW(&HAB8) & ChrW(&HAA0) & " "
WORDs(67) = ChrW(&HAB8) & ChrW(&HAA1) & ChrW(&HAB8) & ChrW(&HAA0) & " "
WORDs(68) = ChrW(&HA85) & ChrW(&HAA1) & ChrW(&HAB8) & ChrW(&HAA0) & " "
WORDs(69) = ChrW(&HA93) & ChrW(&HA97) & ChrW(&HAA3) & ChrW(&HAB8) & ChrW(&HAC0) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
WORDs(70) = ChrW(&HAB8) & ChrW(&HAC0) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
WORDs(71) = ChrW(&HA8F) & ChrW(&HA95) & ChrW(&HACB) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
WORDs(72) = ChrW(&HAAC) & ChrW(&HACB) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
WORDs(73) = ChrW(&HAA4) & ChrW(&HACB) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
WORDs(74) = ChrW(&HA9A) & ChrW(&HAC1) & ChrW(&HAAE) & ChrW(&HACB) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
WORDs(75) = ChrW(&HAAA) & ChrW(&HA82) & ChrW(&HA9A) & ChrW(&HACB) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
WORDs(76) = ChrW(&HA9B) & ChrW(&HACB) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
WORDs(77) = ChrW(&HAB8) & ChrW(&HABF) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAA4) & ChrW(&HACB) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
WORDs(78) = ChrW(&HA85) & ChrW(&HAA0) & ChrW(&HACB) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
WORDs(79) = ChrW(&HA93) & ChrW(&HA97) & ChrW(&HAA3) & ChrW(&HABE) & " " & ChrW(&HA8F) & ChrW(&HA82) & ChrW(&HAB6) & ChrW(&HAC0) & " "
WORDs(80) = ChrW(&HA8F) & ChrW(&HA82) & ChrW(&HAB6) & ChrW(&HAC0) & " "
WORDs(81) = ChrW(&HA8F) & ChrW(&HA95) & ChrW(&HAAF) & ChrW(&HABE) & ChrW(&HAB6) & ChrW(&HAC0) & " "
WORDs(82) = ChrW(&HAAC) & ChrW(&HACD) & ChrW(&HAAF) & ChrW(&HABE) & ChrW(&HA82) & ChrW(&HAB6) & ChrW(&HAC0) & " "
WORDs(83) = ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HABE) & ChrW(&HA82) & ChrW(&HAB8) & ChrW(&HAC0) & " "
WORDs(84) = ChrW(&HA9A) & ChrW(&HACB) & ChrW(&HAB0) & ChrW(&HACD) & ChrW(&HAAF) & ChrW(&HABE) & ChrW(&HAB8) & ChrW(&HAC0) & " "
WORDs(85) = ChrW(&HAAA) & ChrW(&HA82) & ChrW(&HA9A) & ChrW(&HACD) & ChrW(&HAAF) & ChrW(&HABE) & ChrW(&HAB8) & ChrW(&HAC0) & " "
WORDs(86) = ChrW(&HA9B) & ChrW(&HACD) & ChrW(&HAAF) & ChrW(&HABE) & ChrW(&HAB8) & ChrW(&HAC0) & " "
WORDs(87) = ChrW(&HAB8) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAAF) & ChrW(&HABE) & ChrW(&HAB8) & ChrW(&HAC0) & " "
WORDs(88) = ChrW(&HA85) & ChrW(&HAA0) & ChrW(&HACD) & ChrW(&HAAF) & ChrW(&HABE) & ChrW(&HAB8) & ChrW(&HAC0) & " "
WORDs(89) = ChrW(&HAA8) & ChrW(&HAC7) & ChrW(&HAB5) & ChrW(&HACD) & ChrW(&HAAF) & ChrW(&HABE) & ChrW(&HAB8) & ChrW(&HAC0) & " "
WORDs(90) = ChrW(&HAA8) & ChrW(&HAC7) & ChrW(&HAB5) & ChrW(&HAC1) & ChrW(&HA82) & " "
WORDs(91) = ChrW(&HA8F) & ChrW(&HA95) & ChrW(&HABE) & ChrW(&HAA3) & ChrW(&HAC1) & ChrW(&HA82) & " "
WORDs(92) = ChrW(&HAAC) & ChrW(&HABE) & ChrW(&HAA3) & ChrW(&HAC1) & ChrW(&HA82) & " "
WORDs(93) = ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HABE) & ChrW(&HAA3) & ChrW(&HAC1) & ChrW(&HA82) & " "
WORDs(94) = ChrW(&HA9A) & ChrW(&HACB) & ChrW(&HAB0) & ChrW(&HABE) & ChrW(&HAA3) & ChrW(&HAC1) & ChrW(&HA82) & " "
WORDs(95) = ChrW(&HAAA) & ChrW(&HA82) & ChrW(&HA9A) & ChrW(&HABE) & ChrW(&HAA3) & ChrW(&HAC1) & ChrW(&HA82) & " "
WORDs(96) = ChrW(&HA9B) & ChrW(&HAA8) & ChrW(&HACD) & ChrW(&HAA8) & ChrW(&HAC1) & " "
WORDs(97) = ChrW(&HAB8) & ChrW(&HAA4) & ChrW(&HABE) & ChrW(&HAA3) & ChrW(&HAC1) & ChrW(&HA82) & " "
WORDs(98) = ChrW(&HA85) & ChrW(&HAA0) & ChrW(&HABE) & ChrW(&HAA3) & ChrW(&HAC1) & ChrW(&HA82) & " "
WORDs(99) = ChrW(&HAA8) & ChrW(&HAB5) & ChrW(&HACD) & ChrW(&HAB5) & ChrW(&HABE) & ChrW(&HAA3) & ChrW(&HAC1) & ChrW(&HA82) & " "


tens(2) = ChrW(&HAB5) & ChrW(&HAC0) & ChrW(&HAB8) & " "
tens(3) = ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC0) & ChrW(&HAB8) & " "
tens(4) = ChrW(&HA9A) & ChrW(&HABE) & ChrW(&HAB3) & ChrW(&HAC0) & ChrW(&HAB8) & " "
tens(5) = ChrW(&HAAA) & ChrW(&HA9A) & ChrW(&HABE) & ChrW(&HAB8) & " "
tens(6) = ChrW(&HAB8) & ChrW(&HABE) & ChrW(&HAA0) & " "
tens(7) = ChrW(&HAB8) & ChrW(&HAC0) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
tens(8) = ChrW(&HA8F) & ChrW(&HA82) & ChrW(&HAB6) & ChrW(&HAC0) & " "
tens(9) = ChrW(&HAA8) & ChrW(&HAC7) & ChrW(&HAB5) & ChrW(&HAC1) & ChrW(&HA82) & " "


FIGURE = amt
FIGURE = Format(FIGURE, "FIXED")
FIGLEN = Len(FIGURE)


If FIGLEN < 12 Then
FIGURE = Space(12 - FIGLEN) & FIGURE
End If


If Val(Left(FIGURE, 9)) > 1 Then
gwords = ChrW(&HA85) & ChrW(&HA82) & ChrW(&HA95) & ChrW(&HAC7) & " " & ChrW(&HAF1) & ChrW(&HAAA) & ChrW(&HABF) & ChrW(&HAAF) & ChrW(&HABE) & " "
ElseIf Val(Left(FIGURE, 9)) = 1 Then
gwords = ChrW(&HA85) & ChrW(&HA82) & ChrW(&HA95) & ChrW(&HAC7) & " " & ChrW(&HAF1) & ChrW(&HAAA) & ChrW(&HABF) & ChrW(&HAAF) & ChrW(&HABE) & " "
End If


For i = 1 To 3
If Val(Left(FIGURE, 2)) <= 99 And Val(Left(FIGURE, 2)) > 0 Then
gwords = gwords & WORDs(Val(Left(FIGURE, 2)))
ElseIf Val(Left(FIGURE, 2)) > 19 Then
gwords = gwords & tens(Val(Left(FIGURE, 1)))
gwords = gwords & WORDs(Val(Right(Left(FIGURE, 2), 1)))
End If


If i = 1 And Val(Left(FIGURE, 2)) > 0 Then
gwords = gwords & ChrW(&HA95) & ChrW(&HAB0) & ChrW(&HACB) & ChrW(&HAA1) & " "
ElseIf i = 2 And Val(Left(FIGURE, 2)) > 0 Then
gwords = gwords & ChrW(&HAB2) & ChrW(&HABE) & ChrW(&HA96) & " "
ElseIf i = 3 And Val(Left(FIGURE, 2)) > 0 Then
gwords = gwords & ChrW(&HAB9) & ChrW(&HA9C) & ChrW(&HABE) & ChrW(&HAB0) & " "
End If
FIGURE = Mid(FIGURE, 3)
Next i


If Val(Left(FIGURE, 1)) > 0 Then
gwords = gwords & WORDs(Val(Left(FIGURE, 1))) + ChrW(&HAB8) & ChrW(&HACB) & " "
End If


FIGURE = Mid(FIGURE, 2)


If Val(Left(FIGURE, 2)) <= 99 And Val(Left(FIGURE, 2)) > 0 Then
gwords = gwords & WORDs(Val(Left(FIGURE, 2)))
ElseIf Val(Left(FIGURE, 2)) > 19 Then
gwords = gwords & tens(Val(Left(FIGURE, 1)))
gwords = gwords & WORDs(Val(Right(Left(FIGURE, 2), 1)))
End If
FIGURE = Mid(FIGURE, 4)


If Val(FIGURE) > 0 Then
gwords = gwords & ChrW(&HA85) & ChrW(&HAA8) & ChrW(&HAC7) & " " & ChrW(&HAAA) & ChrW(&HAC8) & ChrW(&HAB8) & ChrW(&HABE) & " "
If Val(Left(FIGURE, 2)) <= 99 And Val(Left(FIGURE, 2)) > 0 Then
gwords = gwords & WORDs(Val(Left(FIGURE, 2)))
ElseIf Val(Left(FIGURE, 2)) > 19 Then
gwords = gwords & tens(Val(Left(FIGURE, 1)))
gwords = gwords & WORDs(Val(Right(Left(FIGURE, 2), 1)))
End If
End If
FIGURE = amt
FIGURE = Format(FIGURE, "FIXED")
If Val(FIGURE) > 0 Then
gwords = gwords & ChrW(&HAAA) & ChrW(&HAC1) & ChrW(&HAB0) & ChrW(&HABE) & " "
End If
End Function


'
'This Function Develop by PGC01 & Design by ::aPPu::
'

function use with =gwords(A1)



here it is English Final Code :)
Code:
''This Function Develop by PGC01 & Design by ::aPPu::
'


Function ewords(amt As Variant) As Variant
Dim FIGURE As Variant
Dim LENFIG As Integer
Dim i As Integer
Dim WORDs(19) As String
Dim tens(9) As String
WORDs(1) = "One "
WORDs(2) = "Two "
WORDs(3) = "Three "
WORDs(4) = "Four "
WORDs(5) = "Five "
WORDs(6) = "Six "
WORDs(7) = "Seven "
WORDs(8) = "Eight "
WORDs(9) = "Nine "
WORDs(10) = "Ten "
WORDs(11) = "Eleven "
WORDs(12) = "Twelve "
WORDs(13) = "Thirteen "
WORDs(14) = "Fourteen "
WORDs(15) = "Fifteen "
WORDs(16) = "Sixteen "
WORDs(17) = "Seventeen "
WORDs(18) = "Eighteen "
WORDs(19) = "Nineteen "


tens(2) = "Twenty "
tens(3) = "Thirty "
tens(4) = "Fourty "
tens(5) = "Fifty "
tens(6) = "Sixty "
tens(7) = "Seventy "
tens(8) = "Eighty "
tens(9) = "Ninety "


FIGURE = amt
FIGURE = Format(FIGURE, "FIXED")
FIGLEN = Len(FIGURE)


If FIGLEN < 12 Then
FIGURE = Space(12 - FIGLEN) & FIGURE
End If


If Val(Left(FIGURE, 9)) > 1 Then
ewords = "Rupees "
ElseIf Val(Left(FIGURE, 9)) = 1 Then
ewords = "Rupee "
End If


For i = 1 To 3
If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then
ewords = ewords & WORDs(Val(Left(FIGURE, 2)))
ElseIf Val(Left(FIGURE, 2)) > 19 Then
ewords = ewords & tens(Val(Left(FIGURE, 1)))
ewords = ewords & WORDs(Val(Right(Left(FIGURE, 2), 1)))
End If


If i = 1 And Val(Left(FIGURE, 2)) > 0 Then
ewords = ewords & "Crore "
ElseIf i = 2 And Val(Left(FIGURE, 2)) > 0 Then
ewords = ewords & "Lakh "
ElseIf i = 3 And Val(Left(FIGURE, 2)) > 0 Then
ewords = ewords & "Thousand "
End If
FIGURE = Mid(FIGURE, 3)
Next i


If Val(Left(FIGURE, 1)) > 0 Then
ewords = ewords & WORDs(Val(Left(FIGURE, 1))) + "Hundred "
End If


FIGURE = Mid(FIGURE, 2)


If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then
ewords = ewords & WORDs(Val(Left(FIGURE, 2)))
ElseIf Val(Left(FIGURE, 2)) > 19 Then
ewords = ewords & tens(Val(Left(FIGURE, 1)))
ewords = ewords & WORDs(Val(Right(Left(FIGURE, 2), 1)))
End If
FIGURE = Mid(FIGURE, 4)


If Val(FIGURE) > 0 Then
ewords = ewords & "Paise "
If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then
ewords = ewords & WORDs(Val(Left(FIGURE, 2)))
ElseIf Val(Left(FIGURE, 2)) > 19 Then
ewords = ewords & tens(Val(Left(FIGURE, 1)))
ewords = ewords & WORDs(Val(Right(Left(FIGURE, 2), 1)))
End If
End If
FIGURE = amt
FIGURE = Format(FIGURE, "FIXED")
If Val(FIGURE) > 0 Then
ewords = ewords & "Only"
End If
End Function


'
'This Function Develop by PGC01 & Design by ::aPPu::
'

function use with =ewords(A1)
 
Last edited:
Upvote 0
Hi

I'm glad it's working now and thanks for posting the final code.

'This Function Develop by PGC01 & Design by ::aPPu::

I'd prefer if you'd change it to:

'This Function Develop & Design by ::aPPu:: with the help of PGC01

because I just helped to get you started. You studied the original function, adapted it and solved all the problems, so it's your function.
 
Upvote 0
hello PGC01 sir,

lil more help for 200, when we type 200 it's call for 200 = અંકે ૱પિયા બે સો પુરા, it's wrong in my language, but m need 200 = અંકે ૱પિયા બ સો પુરા

thank's in advance SIR :)
 
Upvote 0
Sorry, I don't understand.

You mean the function works for any number except 200?

Is 200 a special case in your language and needs to be treated separately?
 
Upvote 0
here it is Gujarati final code :)
Code:
''This Function Develop by PGC01 & Design by ::aPPu::
'


Function gwords(amt As Variant) As Variant
Dim FIGURE As Variant
Dim FIGLEN As Integer
Dim i As Integer
Dim WORDs(99) As String
Dim tens(9) As String
WORDs(1) = ChrW(&HA8F) & ChrW(&HA95) & " "
WORDs(2) = ChrW(&HAAC) & ChrW(&HAC7) & " "
WORDs(3) = ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAA3) & " "
WORDs(4) = ChrW(&HA9A) & ChrW(&HABE) & ChrW(&HAB0) & " "
WORDs(5) = ChrW(&HAAA) & ChrW(&HABE) & ChrW(&HA82) & ChrW(&HA9A) & " "
WORDs(6) = ChrW(&HA9B) & " "
WORDs(7) = ChrW(&HAB8) & ChrW(&HABE) & ChrW(&HAA4) & " "
WORDs(8) = ChrW(&HA86) & ChrW(&HAA0) & " "
WORDs(9) = ChrW(&HAA8) & ChrW(&HAB5) & " "
WORDs(10) = ChrW(&HAA6) & ChrW(&HAB8) & " "
WORDs(11) = ChrW(&HA85) & ChrW(&HA97) & ChrW(&HABF) & ChrW(&HAAF) & ChrW(&HABE) & ChrW(&HAB0) & " "
WORDs(12) = ChrW(&HAAC) & ChrW(&HABE) & ChrW(&HAB0) & " "
WORDs(13) = ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
WORDs(14) = ChrW(&HA9A) & ChrW(&HACC) & ChrW(&HAA6) & " "
WORDs(15) = ChrW(&HAAA) & ChrW(&HA82) & ChrW(&HAA6) & ChrW(&HAB0) & " "
WORDs(16) = ChrW(&HAB8) & ChrW(&HACB) & ChrW(&HAB3) & " "
WORDs(17) = ChrW(&HAB8) & ChrW(&HAA4) & ChrW(&HAB0) & " "
WORDs(18) = ChrW(&HA85) & ChrW(&HAA2) & ChrW(&HABE) & ChrW(&HAB0) & " "
WORDs(19) = ChrW(&HA93) & ChrW(&HA97) & ChrW(&HAA3) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(20) = ChrW(&HAB5) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(21) = ChrW(&HA8F) & ChrW(&HA95) & ChrW(&HAB5) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(22) = ChrW(&HAAC) & ChrW(&HABE) & ChrW(&HAB5) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(23) = ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC7) & ChrW(&HAB5) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(24) = ChrW(&HA9A) & ChrW(&HACB) & ChrW(&HAB5) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(25) = ChrW(&HAAA) & ChrW(&HA9A) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(26) = ChrW(&HA9B) & ChrW(&HAB5) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(27) = ChrW(&HAB8) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAA4) & ChrW(&HABE) & ChrW(&HAB5) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(28) = ChrW(&HA85) & ChrW(&HAA0) & ChrW(&HACD) & ChrW(&HAAF) & ChrW(&HABE) & ChrW(&HAB5) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(29) = ChrW(&HA93) & ChrW(&HA97) & ChrW(&HAA3) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(30) = ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(31) = ChrW(&HA8F) & ChrW(&HA95) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(32) = ChrW(&HAAC) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(33) = ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(34) = ChrW(&HA9A) & ChrW(&HACB) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(35) = ChrW(&HAAA) & ChrW(&HABE) & ChrW(&HA82) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(36) = ChrW(&HA9B) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(37) = ChrW(&HAB8) & ChrW(&HABE) & ChrW(&HAA1) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(38) = ChrW(&HA86) & ChrW(&HAA1) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(39) = ChrW(&HA93) & ChrW(&HA97) & ChrW(&HAA3) & ChrW(&HA9A) & ChrW(&HABE) & ChrW(&HAB2) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(40) = ChrW(&HA9A) & ChrW(&HABE) & ChrW(&HAB2) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(41) = ChrW(&HA8F) & ChrW(&HA95) & ChrW(&HAA4) & ChrW(&HABE) & ChrW(&HAB2) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(42) = ChrW(&HAAC) & ChrW(&HAC7) & ChrW(&HAA4) & ChrW(&HABE) & ChrW(&HAB2) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(43) = ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAA4) & ChrW(&HABE) & ChrW(&HAB2) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(44) = ChrW(&HA9A) & ChrW(&HAC1) & ChrW(&HAAE) & ChrW(&HABE) & ChrW(&HAB2) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(45) = ChrW(&HAAA) & ChrW(&HABF) & ChrW(&HAB8) & ChrW(&HACD) & ChrW(&HAA4) & ChrW(&HABE) & ChrW(&HAB2) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(46) = ChrW(&HA9B) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HABE) & ChrW(&HAB2) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(47) = ChrW(&HAB8) & ChrW(&HAA1) & ChrW(&HAA4) & ChrW(&HABE) & ChrW(&HAB2) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(48) = ChrW(&HA85) & ChrW(&HAA1) & ChrW(&HAA4) & ChrW(&HABE) & ChrW(&HAB2) & ChrW(&HAC0) & ChrW(&HAB8) & " "
WORDs(49) = ChrW(&HA93) & ChrW(&HA97) & ChrW(&HAA3) & ChrW(&HAAA) & ChrW(&HA9A) & ChrW(&HABE) & ChrW(&HAB8) & " "
WORDs(50) = ChrW(&HAAA) & ChrW(&HA9A) & ChrW(&HABE) & ChrW(&HAB8) & " "
WORDs(51) = ChrW(&HA8F) & ChrW(&HA95) & ChrW(&HABE) & ChrW(&HAB5) & ChrW(&HAA8) & " "
WORDs(52) = ChrW(&HAAC) & ChrW(&HABE) & ChrW(&HAB5) & ChrW(&HAA8) & " "
WORDs(53) = ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC7) & ChrW(&HAAA) & ChrW(&HAA8) & " "
WORDs(54) = ChrW(&HA9A) & ChrW(&HACB) & ChrW(&HAAA) & ChrW(&HAA8) & " "
WORDs(55) = ChrW(&HAAA) & ChrW(&HA82) & ChrW(&HA9A) & ChrW(&HABE) & ChrW(&HAB5) & ChrW(&HAA8) & " "
WORDs(56) = ChrW(&HA9B) & ChrW(&HAAA) & ChrW(&HACD) & ChrW(&HAAA) & ChrW(&HAA8) & " "
WORDs(57) = ChrW(&HAB8) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAA4) & ChrW(&HABE) & ChrW(&HAB5) & ChrW(&HAA8) & " "
WORDs(58) = ChrW(&HA85) & ChrW(&HAA0) & ChrW(&HABE) & ChrW(&HAB5) & ChrW(&HAA8) & " "
WORDs(59) = ChrW(&HA93) & ChrW(&HA97) & ChrW(&HAA3) & ChrW(&HAB8) & ChrW(&HABE) & ChrW(&HA87) & ChrW(&HAA0) & " "
WORDs(60) = ChrW(&HAB8) & ChrW(&HABE) & ChrW(&HA87) & ChrW(&HAA0) & " "
WORDs(61) = ChrW(&HA8F) & ChrW(&HA95) & ChrW(&HAB8) & ChrW(&HAA0) & " "
WORDs(62) = ChrW(&HAAC) & ChrW(&HABE) & ChrW(&HAB8) & ChrW(&HAA0) & " "
WORDs(63) = ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC7) & ChrW(&HAB8) & ChrW(&HAA0) & " "
WORDs(64) = ChrW(&HA9A) & ChrW(&HACB) & ChrW(&HAB8) & ChrW(&HAA0) & " "
WORDs(65) = ChrW(&HAAA) & ChrW(&HABE) & ChrW(&HAB8) & ChrW(&HAA0) & " "
WORDs(66) = ChrW(&HA9B) & ChrW(&HABE) & ChrW(&HAB8) & ChrW(&HAA0) & " "
WORDs(67) = ChrW(&HAB8) & ChrW(&HAA1) & ChrW(&HAB8) & ChrW(&HAA0) & " "
WORDs(68) = ChrW(&HA85) & ChrW(&HAA1) & ChrW(&HAB8) & ChrW(&HAA0) & " "
WORDs(69) = ChrW(&HA93) & ChrW(&HA97) & ChrW(&HAA3) & ChrW(&HAB8) & ChrW(&HAC0) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
WORDs(70) = ChrW(&HAB8) & ChrW(&HAC0) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
WORDs(71) = ChrW(&HA8F) & ChrW(&HA95) & ChrW(&HACB) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
WORDs(72) = ChrW(&HAAC) & ChrW(&HACB) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
WORDs(73) = ChrW(&HAA4) & ChrW(&HACB) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
WORDs(74) = ChrW(&HA9A) & ChrW(&HAC1) & ChrW(&HAAE) & ChrW(&HACB) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
WORDs(75) = ChrW(&HAAA) & ChrW(&HA82) & ChrW(&HA9A) & ChrW(&HACB) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
WORDs(76) = ChrW(&HA9B) & ChrW(&HACB) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
WORDs(77) = ChrW(&HAB8) & ChrW(&HABF) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAA4) & ChrW(&HACB) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
WORDs(78) = ChrW(&HA85) & ChrW(&HAA0) & ChrW(&HACB) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
WORDs(79) = ChrW(&HA93) & ChrW(&HA97) & ChrW(&HAA3) & ChrW(&HABE) & " " & ChrW(&HA8F) & ChrW(&HA82) & ChrW(&HAB6) & ChrW(&HAC0) & " "
WORDs(80) = ChrW(&HA8F) & ChrW(&HA82) & ChrW(&HAB6) & ChrW(&HAC0) & " "
WORDs(81) = ChrW(&HA8F) & ChrW(&HA95) & ChrW(&HAAF) & ChrW(&HABE) & ChrW(&HAB6) & ChrW(&HAC0) & " "
WORDs(82) = ChrW(&HAAC) & ChrW(&HACD) & ChrW(&HAAF) & ChrW(&HABE) & ChrW(&HA82) & ChrW(&HAB6) & ChrW(&HAC0) & " "
WORDs(83) = ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HABE) & ChrW(&HA82) & ChrW(&HAB8) & ChrW(&HAC0) & " "
WORDs(84) = ChrW(&HA9A) & ChrW(&HACB) & ChrW(&HAB0) & ChrW(&HACD) & ChrW(&HAAF) & ChrW(&HABE) & ChrW(&HAB8) & ChrW(&HAC0) & " "
WORDs(85) = ChrW(&HAAA) & ChrW(&HA82) & ChrW(&HA9A) & ChrW(&HACD) & ChrW(&HAAF) & ChrW(&HABE) & ChrW(&HAB8) & ChrW(&HAC0) & " "
WORDs(86) = ChrW(&HA9B) & ChrW(&HACD) & ChrW(&HAAF) & ChrW(&HABE) & ChrW(&HAB8) & ChrW(&HAC0) & " "
WORDs(87) = ChrW(&HAB8) & ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAAF) & ChrW(&HABE) & ChrW(&HAB8) & ChrW(&HAC0) & " "
WORDs(88) = ChrW(&HA85) & ChrW(&HAA0) & ChrW(&HACD) & ChrW(&HAAF) & ChrW(&HABE) & ChrW(&HAB8) & ChrW(&HAC0) & " "
WORDs(89) = ChrW(&HAA8) & ChrW(&HAC7) & ChrW(&HAB5) & ChrW(&HACD) & ChrW(&HAAF) & ChrW(&HABE) & ChrW(&HAB8) & ChrW(&HAC0) & " "
WORDs(90) = ChrW(&HAA8) & ChrW(&HAC7) & ChrW(&HAB5) & ChrW(&HAC1) & ChrW(&HA82) & " "
WORDs(91) = ChrW(&HA8F) & ChrW(&HA95) & ChrW(&HABE) & ChrW(&HAA3) & ChrW(&HAC1) & ChrW(&HA82) & " "
WORDs(92) = ChrW(&HAAC) & ChrW(&HABE) & ChrW(&HAA3) & ChrW(&HAC1) & ChrW(&HA82) & " "
WORDs(93) = ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HABE) & ChrW(&HAA3) & ChrW(&HAC1) & ChrW(&HA82) & " "
WORDs(94) = ChrW(&HA9A) & ChrW(&HACB) & ChrW(&HAB0) & ChrW(&HABE) & ChrW(&HAA3) & ChrW(&HAC1) & ChrW(&HA82) & " "
WORDs(95) = ChrW(&HAAA) & ChrW(&HA82) & ChrW(&HA9A) & ChrW(&HABE) & ChrW(&HAA3) & ChrW(&HAC1) & ChrW(&HA82) & " "
WORDs(96) = ChrW(&HA9B) & ChrW(&HAA8) & ChrW(&HACD) & ChrW(&HAA8) & ChrW(&HAC1) & " "
WORDs(97) = ChrW(&HAB8) & ChrW(&HAA4) & ChrW(&HABE) & ChrW(&HAA3) & ChrW(&HAC1) & ChrW(&HA82) & " "
WORDs(98) = ChrW(&HA85) & ChrW(&HAA0) & ChrW(&HABE) & ChrW(&HAA3) & ChrW(&HAC1) & ChrW(&HA82) & " "
WORDs(99) = ChrW(&HAA8) & ChrW(&HAB5) & ChrW(&HACD) & ChrW(&HAB5) & ChrW(&HABE) & ChrW(&HAA3) & ChrW(&HAC1) & ChrW(&HA82) & " "


tens(2) = ChrW(&HAB5) & ChrW(&HAC0) & ChrW(&HAB8) & " "
tens(3) = ChrW(&HAA4) & ChrW(&HACD) & ChrW(&HAB0) & ChrW(&HAC0) & ChrW(&HAB8) & " "
tens(4) = ChrW(&HA9A) & ChrW(&HABE) & ChrW(&HAB3) & ChrW(&HAC0) & ChrW(&HAB8) & " "
tens(5) = ChrW(&HAAA) & ChrW(&HA9A) & ChrW(&HABE) & ChrW(&HAB8) & " "
tens(6) = ChrW(&HAB8) & ChrW(&HABE) & ChrW(&HAA0) & " "
tens(7) = ChrW(&HAB8) & ChrW(&HAC0) & ChrW(&HAA4) & ChrW(&HAC7) & ChrW(&HAB0) & " "
tens(8) = ChrW(&HA8F) & ChrW(&HA82) & ChrW(&HAB6) & ChrW(&HAC0) & " "
tens(9) = ChrW(&HAA8) & ChrW(&HAC7) & ChrW(&HAB5) & ChrW(&HAC1) & ChrW(&HA82) & " "


FIGURE = amt
FIGURE = Format(FIGURE, "FIXED")
FIGLEN = Len(FIGURE)


If FIGLEN < 12 Then
FIGURE = Space(12 - FIGLEN) & FIGURE
End If


If Val(Left(FIGURE, 9)) > 1 Then
gwords = ChrW(&HA85) & ChrW(&HA82) & ChrW(&HA95) & ChrW(&HAC7) & " " & ChrW(&HAF1) & ChrW(&HAAA) & ChrW(&HABF) & ChrW(&HAAF) & ChrW(&HABE) & " "
ElseIf Val(Left(FIGURE, 9)) = 1 Then
gwords = ChrW(&HA85) & ChrW(&HA82) & ChrW(&HA95) & ChrW(&HAC7) & " " & ChrW(&HAF1) & ChrW(&HAAA) & ChrW(&HABF) & ChrW(&HAAF) & ChrW(&HABE) & " "
End If


For i = 1 To 3
If Val(Left(FIGURE, 2)) <= 99 And Val(Left(FIGURE, 2)) > 0 Then
gwords = gwords & WORDs(Val(Left(FIGURE, 2)))
ElseIf Val(Left(FIGURE, 2)) > 19 Then
gwords = gwords & tens(Val(Left(FIGURE, 1)))
gwords = gwords & WORDs(Val(Right(Left(FIGURE, 2), 1)))
End If


If i = 1 And Val(Left(FIGURE, 2)) > 0 Then
gwords = gwords & ChrW(&HA95) & ChrW(&HAB0) & ChrW(&HACB) & ChrW(&HAA1) & " "
ElseIf i = 2 And Val(Left(FIGURE, 2)) > 0 Then
gwords = gwords & ChrW(&HAB2) & ChrW(&HABE) & ChrW(&HA96) & " "
ElseIf i = 3 And Val(Left(FIGURE, 2)) > 0 Then
gwords = gwords & ChrW(&HAB9) & ChrW(&HA9C) & ChrW(&HABE) & ChrW(&HAB0) & " "
End If
FIGURE = Mid(FIGURE, 3)
Next i


If Val(Left(FIGURE, 1)) > 0 Then
gwords = gwords & WORDs(Val(Left(FIGURE, 1))) + ChrW(&HAB8) & ChrW(&HACB) & " "
End If


FIGURE = Mid(FIGURE, 2)


If Val(Left(FIGURE, 2)) <= 99 And Val(Left(FIGURE, 2)) > 0 Then
gwords = gwords & WORDs(Val(Left(FIGURE, 2)))
ElseIf Val(Left(FIGURE, 2)) > 19 Then
gwords = gwords & tens(Val(Left(FIGURE, 1)))
gwords = gwords & WORDs(Val(Right(Left(FIGURE, 2), 1)))
End If
FIGURE = Mid(FIGURE, 4)


If Val(FIGURE) > 0 Then
gwords = gwords & ChrW(&HA85) & ChrW(&HAA8) & ChrW(&HAC7) & " " & ChrW(&HAAA) & ChrW(&HAC8) & ChrW(&HAB8) & ChrW(&HABE) & " "
If Val(Left(FIGURE, 2)) <= 99 And Val(Left(FIGURE, 2)) > 0 Then
gwords = gwords & WORDs(Val(Left(FIGURE, 2)))
ElseIf Val(Left(FIGURE, 2)) > 19 Then
gwords = gwords & tens(Val(Left(FIGURE, 1)))
gwords = gwords & WORDs(Val(Right(Left(FIGURE, 2), 1)))
End If
End If
FIGURE = amt
FIGURE = Format(FIGURE, "FIXED")
If Val(FIGURE) > 0 Then
gwords = gwords & ChrW(&HAAA) & ChrW(&HAC1) & ChrW(&HAB0) & ChrW(&HABE) & " "
End If
End Function


'
'This Function Develop by PGC01 & Design by ::aPPu::
'

function use with =gwords(A1)



here it is English Final Code :)
Code:
''This Function Develop by PGC01 & Design by ::aPPu::
'


Function ewords(amt As Variant) As Variant
Dim FIGURE As Variant
Dim LENFIG As Integer
Dim i As Integer
Dim WORDs(19) As String
Dim tens(9) As String
WORDs(1) = "One "
WORDs(2) = "Two "
WORDs(3) = "Three "
WORDs(4) = "Four "
WORDs(5) = "Five "
WORDs(6) = "Six "
WORDs(7) = "Seven "
WORDs(8) = "Eight "
WORDs(9) = "Nine "
WORDs(10) = "Ten "
WORDs(11) = "Eleven "
WORDs(12) = "Twelve "
WORDs(13) = "Thirteen "
WORDs(14) = "Fourteen "
WORDs(15) = "Fifteen "
WORDs(16) = "Sixteen "
WORDs(17) = "Seventeen "
WORDs(18) = "Eighteen "
WORDs(19) = "Nineteen "


tens(2) = "Twenty "
tens(3) = "Thirty "
tens(4) = "Fourty "
tens(5) = "Fifty "
tens(6) = "Sixty "
tens(7) = "Seventy "
tens(8) = "Eighty "
tens(9) = "Ninety "


FIGURE = amt
FIGURE = Format(FIGURE, "FIXED")
FIGLEN = Len(FIGURE)


If FIGLEN < 12 Then
FIGURE = Space(12 - FIGLEN) & FIGURE
End If


If Val(Left(FIGURE, 9)) > 1 Then
ewords = "Rupees "
ElseIf Val(Left(FIGURE, 9)) = 1 Then
ewords = "Rupee "
End If


For i = 1 To 3
If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then
ewords = ewords & WORDs(Val(Left(FIGURE, 2)))
ElseIf Val(Left(FIGURE, 2)) > 19 Then
ewords = ewords & tens(Val(Left(FIGURE, 1)))
ewords = ewords & WORDs(Val(Right(Left(FIGURE, 2), 1)))
End If


If i = 1 And Val(Left(FIGURE, 2)) > 0 Then
ewords = ewords & "Crore "
ElseIf i = 2 And Val(Left(FIGURE, 2)) > 0 Then
ewords = ewords & "Lakh "
ElseIf i = 3 And Val(Left(FIGURE, 2)) > 0 Then
ewords = ewords & "Thousand "
End If
FIGURE = Mid(FIGURE, 3)
Next i


If Val(Left(FIGURE, 1)) > 0 Then
ewords = ewords & WORDs(Val(Left(FIGURE, 1))) + "Hundred "
End If


FIGURE = Mid(FIGURE, 2)


If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then
ewords = ewords & WORDs(Val(Left(FIGURE, 2)))
ElseIf Val(Left(FIGURE, 2)) > 19 Then
ewords = ewords & tens(Val(Left(FIGURE, 1)))
ewords = ewords & WORDs(Val(Right(Left(FIGURE, 2), 1)))
End If
FIGURE = Mid(FIGURE, 4)


If Val(FIGURE) > 0 Then
ewords = ewords & "Paise "
If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then
ewords = ewords & WORDs(Val(Left(FIGURE, 2)))
ElseIf Val(Left(FIGURE, 2)) > 19 Then
ewords = ewords & tens(Val(Left(FIGURE, 1)))
ewords = ewords & WORDs(Val(Right(Left(FIGURE, 2), 1)))
End If
End If
FIGURE = amt
FIGURE = Format(FIGURE, "FIXED")
If Val(FIGURE) > 0 Then
ewords = ewords & "Only"
End If
End Function


'
'This Function Develop by PGC01 & Design by ::aPPu::
'

function use with =ewords(A1)

Thanks mate for code but ewords function Dim LENFIG As Integer Should be Dim FIGLEN As Integer.
Sorry I can't help you with Gujarati function

Biz
 
Upvote 0
hello ever 1,

this is my 1st post,

please tell me how to use Indic Gujarati Language in VBA with Excel 2003?

i m need to English Number to Gujarati Text formula, if any one have it give me, thank';s in advance :)

like 120=એક સો વીસ

thank's in advance :)

plz send me full function of gujarati. બ and બે solve pls. and also રૂપિયા
p
 
Upvote 0
Thanks mate for code but ewords function Dim LENFIG As Integer Should be Dim FIGLEN As Integer.
Sorry I can't help you with Gujarati function

Biz
The problem is this line
WORDs(2) = ChrW(&HAAC) & ChrW(&HAC7) & " "
this defines 2 as બે and in 200 you require બ.
so you have to add codes for on to nine hundreds.
I an doing so by mega formula, but tte problem is it requires total 10 cells. and you have to give cell references for numbers and words.
 

Attachments

  • GujNoToWord.JPG
    GujNoToWord.JPG
    58.1 KB · Views: 7
Upvote 0

Forum statistics

Threads
1,223,715
Messages
6,174,064
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top