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 :)
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Hi
Welcome to the board

What it seem is that you want to do a conversion from a numberic value into Gujarati words.

There is no such function, not even for English words (only for Thai, I think). It is, however, very easy to make one.

If you know vba you can adapt the example by ms, that converts a numeric value to English words, here:

How to convert a numeric value into English words in Excel


Maybe you can also find in the web a similar function made by anyone that had the same problem and decided to share.
 
Last edited:
Upvote 0
Hi
Welcome to the board

What it seem is that you want to do a conversion from a numberic value into Gujarati words.

There is no such function, not even for English words (only for Thai, I think). It is, however, very easy to make one.

If you know vba you can adapt the example by ms, that converts a numeric value to English words, here:

How to convert a numeric value into English words in Excel


Maybe you can also find in the web a similar function made by anyone that had the same problem and decided to share.

thank's for reply SIR,

Number to Text in English i have it, but i need Gujarati. if u know how to use GUJARATI in VBA, then tell me...

thank's :)
 
Upvote 0
if u know how to use GUJARATI in VBA, then tell me...

For English you can edit directly the characters in vba since it only uses latin letter withour diacritics.

For any other characters, in any language

- you compose the strings using the respective Unicode codes.

or

- you use a program where you can edit directly in your language and whre you can export the text to excel, import it to excel and load the values to vba.

For ex. એક has 2 characters એ (code hex 0A8F) and ક (hex 0A95)

To compose the string and write to a cell, try:

Code:
Sub WriteOne()
Dim sOne As String

sOne = ChrW(&HA8F) & ChrW(&HA95)
Range("A1").Value = s
End Sub

This writes the word in cell A1 in the active sheet.

There are lots of places with the Unicode characters table, you can Google it.
I found this one:

Gujarati Unicode Entities

This way you can modify the ms code to your language.
 
Upvote 0
For English you can edit directly the characters in vba since it only uses latin letter withour diacritics.

For any other characters, in any language

- you compose the strings using the respective Unicode codes.

or

- you use a program where you can edit directly in your language and whre you can export the text to excel, import it to excel and load the values to vba.

For ex. એક has 2 characters એ (code hex 0A8F) and ક (hex 0A95)

To compose the string and write to a cell, try:

Code:
Sub WriteOne()
Dim sOne As String

sOne = ChrW(&HA8F) & ChrW(&HA95)
Range("A1").Value = s
End Sub

This writes the word in cell A1 in the active sheet.

There are lots of places with the Unicode characters table, you can Google it.
I found this one:

Gujarati Unicode Entities

This way you can modify the ms code to your language.


thank's for this one :)

but i don't know how to use that one

check this one, i want to add here

Code:
[URL="https://docs.google.com/open?id=0B0***KvP4cYAOEZaYzRaVzdOT28"]https://docs.google.com/open?id=0B0***KvP4cYAOEZaYzRaVzdOT28[/URL]

will u define in one line, how to use this one, then i will do it for all line :)

thank's in advance for this :)
 
Upvote 0
Hi

The company does not allow downloads or to open external files.

If you have a doubt in a specific statement post it and I'll try to correct it.
 
Upvote 0
Hi

The company does not allow downloads or to open external files.

If you have a doubt in a specific statement post it and I'll try to correct it.

here it is code:
Code:
Function Ntow(amt As Variant) As VariantDim FIGURE As Variant
Dim LENFIG As Integer
Dim i As Integer
Dim WORDs(19) As String
Dim tens(9) As String
WORDs(1) = "એક "
WORDs(2) = "બે "
WORDs(3) = "ત્રણ "
WORDs(4) = "ચાર "
WORDs(5) = "પાંચ "
WORDs(6) = "છ "
WORDs(7) = "સાત "
WORDs(8) = "આઠ "
WORDs(9) = "નવ "
WORDs(10) = "દસ "
WORDs(11) = "અગિયાર "
WORDs(12) = "બાર "
WORDs(13) = "તેર "
WORDs(14) = "ચૌદ "
WORDs(15) = "પંદર "
WORDs(16) = "સોળ "
WORDs(17) = "સતર "
WORDs(18) = "અઢાર "
WORDs(19) = "ઓગણીસ "


tens(2) = "વીસ "
tens(3) = "ત્રીસ "
tens(4) = "ચાલીસ "
tens(5) = "પચાસ "
tens(6) = "સાઇઠ "
tens(7) = "સીંતેર "
tens(8) = "એંસી "
tens(9) = "નેવું "


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
Ntow = "રૂા. "
ElseIf Val(Left(FIGURE, 9)) = 1 Then
Ntow = "રૂા. "
End If


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


If i = 1 And Val(Left(FIGURE, 2)) > 0 Then
Ntow = Ntow & "કરોડ "
ElseIf i = 2 And Val(Left(FIGURE, 2)) > 0 Then
Ntow = Ntow & "લાખ "
ElseIf i = 3 And Val(Left(FIGURE, 2)) > 0 Then
Ntow = Ntow & "હજાર "
End If
FIGURE = Mid(FIGURE, 3)
Next i


If Val(Left(FIGURE, 1)) > 0 Then
Ntow = Ntow & WORDs(Val(Left(FIGURE, 1))) + "સો "
End If


FIGURE = Mid(FIGURE, 2)


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


If Val(FIGURE) > 0 Then
Ntow = Ntow & "પૈસા "
If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then
Ntow = Ntow & WORDs(Val(Left(FIGURE, 2)))
ElseIf Val(Left(FIGURE, 2)) > 19 Then
Ntow = Ntow & tens(Val(Left(FIGURE, 1)))
Ntow = Ntow & WORDs(Val(Right(Left(FIGURE, 2), 1)))
End If
End If
FIGURE = amt
FIGURE = Format(FIGURE, "FIXED")
If Val(FIGURE) > 0 Then
Ntow = Ntow & "પુરા"
End If
End Function
 
Upvote 0
here it is code:
Code:
Function Ntow(amt As Variant) As VariantDim FIGURE As Variant
Dim LENFIG As Integer
Dim i As Integer
Dim WORDs(19) As String
Dim tens(9) As String
WORDs(1) = "એક "
WORDs(2) = "બે "
WORDs(3) = "ત્રણ "
WORDs(4) = "ચાર "
WORDs(5) = "પાંચ "
WORDs(6) = "છ "
WORDs(7) = "સાત "
WORDs(8) = "આઠ "
WORDs(9) = "નવ "
WORDs(10) = "દસ "
WORDs(11) = "અગિયાર "
WORDs(12) = "બાર "
WORDs(13) = "તેર "
WORDs(14) = "ચૌદ "
WORDs(15) = "પંદર "
WORDs(16) = "સોળ "
WORDs(17) = "સતર "
WORDs(18) = "અઢાર "
WORDs(19) = "ઓગણીસ "


tens(2) = "વીસ "
tens(3) = "ત્રીસ "
tens(4) = "ચાલીસ "
tens(5) = "પચાસ "
tens(6) = "સાઇઠ "
tens(7) = "સીંતેર "
tens(8) = "એંસી "
tens(9) = "નેવું "


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
Ntow = "રૂા. "
ElseIf Val(Left(FIGURE, 9)) = 1 Then
Ntow = "રૂા. "
End If


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


If i = 1 And Val(Left(FIGURE, 2)) > 0 Then
Ntow = Ntow & "કરોડ "
ElseIf i = 2 And Val(Left(FIGURE, 2)) > 0 Then
Ntow = Ntow & "લાખ "
ElseIf i = 3 And Val(Left(FIGURE, 2)) > 0 Then
Ntow = Ntow & "હજાર "
End If
FIGURE = Mid(FIGURE, 3)
Next i


If Val(Left(FIGURE, 1)) > 0 Then
Ntow = Ntow & WORDs(Val(Left(FIGURE, 1))) + "સો "
End If


FIGURE = Mid(FIGURE, 2)


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


If Val(FIGURE) > 0 Then
Ntow = Ntow & "પૈસા "
If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then
Ntow = Ntow & WORDs(Val(Left(FIGURE, 2)))
ElseIf Val(Left(FIGURE, 2)) > 19 Then
Ntow = Ntow & tens(Val(Left(FIGURE, 1)))
Ntow = Ntow & WORDs(Val(Right(Left(FIGURE, 2), 1)))
End If
End If
FIGURE = amt
FIGURE = Format(FIGURE, "FIXED")
If Val(FIGURE) > 0 Then
Ntow = Ntow & "પુરા"
End If
End Function

How did you manage to use Gujarati characters in your Function because I get question marks only?

Biz
 
Upvote 0

Forum statistics

Threads
1,223,714
Messages
6,174,052
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