Link to home
Start Free TrialLog in
Avatar of Hassanay
Hassanay

asked on

Excell macro to translate curency numbers into test in Arabic

I have an excell sheet which contains currencies amount, i need a macro that can translate this currencies into Text, but the problem is that the currency is in Saudi riyals & i need the text to be in arabic
Avatar of Arno Koster
Arno Koster
Flag of Netherlands image

It could be as simple as using formatting to supply the format you are looking for :

select the cells you want to format
right-mouse-click
select cell properties
in the 'number' tab, select "Custom" category
in the "type" section you can supply an arbitrary layout, such as :

standard saudi currency format (eg 123.45 ¿.¿ )
[$¿.¿.¿-401] #.##0,00_-

custom format (eg SAR 123.45)
[$SAR] #.##0,00_-

custom format (eg bladibla 123.45)
"bladibla " #.##0,00_-

The copy-pasting of the riyal formatting did not work as expected, to use the standard saudi currency format use these steps :

select the cells you want to format
right-mouse-click on the selected cells
select cell properties
in the 'number' tab, select "Currency" category
in the 'symbol' section, choose appropriate symbol from the list (Arabic - saudi arabia)
click OK
Avatar of Hassanay
Hassanay

ASKER

maybe you got me wrong, i want to translate number to text, ex: 100..it must give me one hundred riyals,bit i want the text in Arabic not english
VBA does not have a built-in way to do this.  There are various examples of user-defined functions if you Google it, e.g. http://www.ozgrid.com/VBA/ValueToWords.htm, but this is obviously in English and I guess it would not be simple to translate it to Arabic, unless numbers are read out  with exactly the same structure as in English which seems unlikely.  It might be worth taking a look at the code to see if you could adapt it - my Arabic is not good enough, I'm afraid.
thankx, i got the module, but the prblem when am trying to replace the english text to rabaic but it is giving me ????,,ex: thousand.....must be ¿¿¿  but it is writing ???

is there any suggestion?
ASKER CERTIFIED SOLUTION
Avatar of andrewssd3
andrewssd3
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sorry but i cant see any macro of function in the attached
It's called GetNumberStrings in modArabic - you should be able to find it in the Macros list on the developer tab.  Not sure what version of Excel you have, but you may need to enable macros when you open, or if it's 2010 allow content from the web in the bar atthe top of the worksheet
This looks to be a very comprehensive article about doing this in Arabic, although it's for C# code, it may have some ideas you can use: http://www.codeproject.com/KB/cs/NumberToWord.aspx
Thats ok, but i have to do a lot of work here, i hoped it will work as the english one!