close

Hi,
I am Using Excel for my Billing Purposes, i want that excel print the amount
in words for Eg: if my total is 3,046.78 then i want excel print this numeric
digit in Ruppes Three Thousand Fourty Six amp; Paise Seventy Eight Only.

try out this small custom function straight from miscrosoft help

support.microsoft.com/default...b;en-us;213360

U need to customize it to your need.
quot;Yaman Mahajanquot; wrote:

gt; Hi,
gt; I am Using Excel for my Billing Purposes, i want that excel print the amount
gt; in words for Eg: if my total is 3,046.78 then i want excel print this numeric
gt; digit in Ruppes Three Thousand Fourty Six amp; Paise Seventy Eight Only.

Function InLetters(NumberToLeters)
x = Int(Round(NumberToLeters, 2))
DES = Right(Application.WorksheetFunction.Text(NumberToL eters, quot;0.00quot;), 2)

If DES gt; 0 Then
des1 = quot; AND quot; amp; Right(DES, 2) amp; quot;/100 quot;
End IfFirstTwoDigits = Right(x, 2)
Onetonine = Array(quot;quot;, quot; ONE quot;, quot; TWO quot;, quot; THREE quot;, quot; FOUR quot;, quot; FIVE quot;, quot; SIX
quot;, quot; SEVEN quot;, quot; EIGHT quot;, quot; NINE quot;, quot; TEN quot;, _
quot; ELEVEN quot;, quot; TWELVE quot;, quot; THIRTEEN quot;, quot; FOURTEEN quot;, quot; FIFTEEN quot;, quot; SIXTEEN
quot;, quot; SEVENTEEN quot;, quot; EIGHTEEN quot;, quot; NINETEEN quot;, quot; TWENTY quot;, _
quot; TWENTY ONEquot;, quot; TWENTY TWO quot;, quot; TWENTY THREE quot;, quot; TWENTY FOUR quot;, quot; TWENTY
FIVE quot;, quot; TWENTY SIX quot;, quot; TWENTY SEVEN quot;, quot; TWENTY EIGHT quot;, quot; TWENTY NINE quot;,
quot; THIRTY quot;, _
quot; THIRTY ONE quot;, quot; THIRTY TWO quot;, quot; THIRTY THREE quot;, quot; THIRTY FOUR quot;, quot; THIRTY
FIVE quot;, quot; THIRTY SIX quot;, quot; THIRTY SEVEN quot;, quot; THIRTY EIGHT quot;, quot; THIRTY NINE quot;,
quot; FORTY quot;, _
quot; FORTY ONE quot;, quot; FORTY TWO quot;, quot; FORTY THREE quot;, quot; FORTY FOUR quot;, quot; FORTY FIVE
quot;, quot; FORTY SIX quot;, quot; FORTY SEVEN quot;, quot; FORTY EIGHT quot;, quot; FORTY NINE quot;, quot; FIFTY
quot;, _
quot; FIFTY ONE quot;, quot; FIFTY TWO quot;, quot; FIFTY THREE quot;, quot; FIFTY FOUR quot;, quot; FIFTY FIVE
quot;, quot; FIFTY SIX quot;, quot; FIFTY SEVEN quot;, quot; FIFTY EIGHT quot;, quot; FIFTY NINE quot;, quot; SIXTY
quot;, _
quot; SIXTY ONE quot;, quot; SIXTY TWO quot;, quot; SIXTY THREE quot;, quot; SIXTY FOUR quot;, quot; SIXTY FIVE
quot;, quot; SIXTY SIX quot;, quot; SIXTY SEVEN quot;, quot; SIXTY EIGHT quot;, quot; SIXTY NINE quot;, quot; SEVENTY
quot;, _
quot; SEVENTY ONE quot;, quot; SEVENTY TWO quot;, quot; SEVENTY THREE quot;, quot; SEVENTY FOUR quot;, quot;
SEVENTY FIVE quot;, quot; SEVENTY SIX quot;, quot; SEVENTY SEVEN quot;, quot; SEVENTY EIGHT quot;, quot;
SEVENTY NINE quot;, quot; EIGHTY quot;, _
quot; EIGHTY ONE quot;, quot; EIGHTY TWO quot;, quot; EIGHTY THREE quot;, quot; EIGHTY FOUR quot;, quot; EIGHTY
FIVE quot;, quot; EIGHTY SIX quot;, quot; EIGHTY SEVEN quot;, quot; EIGHTY EIGHT quot;, quot; EIGHTY NINE quot;,
quot; NINETY quot;, _
quot; NINETY ONE quot;, quot; NINETY TWO quot;, quot; NINETY THREE quot;, quot; NINETY FOUR quot;, quot; NINETY
FIVE quot;, quot; NINETY SIX quot;, quot; NINETY SEVEN quot;, quot; NINETY EIGHT quot;, quot; NINETY NINE quot;)

FirstTwoDigits1 = Onetonine(FirstTwoDigits)

'---------------
ThirdDigit = Int(Right(x, 3) / 100)

If ThirdDigit gt; 0 Then
ThirdDigit1 = Onetonine(ThirdDigit) amp; quot;HUNDREDquot;
End If

'----------------
FirstSixDigits = Right(x, 6)
NoOfThosands = Int(FirstSixDigits / 1000)

FourthAndFifthDigit = Right(NoOfThosands, 2)
If FourthAndFifthDigit gt; 0 Then
FourthAndFifthDigit1 = Onetonine(FourthAndFifthDigit) amp; quot; THOUSAND quot;
End If
SixthDigit = Int(FirstSixDigits / 100000)
If SixthDigit gt; 0 Then
SixthDigit1 = Onetonine(SixthDigit) amp; quot; HUNDRED quot;
End If
If FourthAndFifthDigit = 0 And SixthDigit gt; 0 Then
SixthDigit2 = SixthDigit1 amp; quot;THOUSANDquot;
Else
SixthDigit2 = SixthDigit1
End If
'---------

SeventhAndEighth = Right(x, 8)
NoOfMillions = Int(SeventhAndEighth / 1000000)

If NoOfMillions gt; 0 Then
NoOfMillions1 = Onetonine(NoOfMillions) amp; quot;MILLIONquot;
End If

If NumberToLeters gt; 0 And NumberToLeters lt; 100000000 Then
InLetters = Application.WorksheetFunction.Proper(Trim(NoOfMill ions1 amp;
SixthDigit2 amp; FourthAndFifthDigit1 amp; ThirdDigit1 amp; FirstTwoDigits1 amp; des1 amp; quot;
ONLY quot;))
End If
If NumberToLeters = 100000000 Then
InLetters = quot;HUNDRED MILLION ONLY quot;
End If

End Functionquot;Shashankquot; wrote:

gt; try out this small custom function straight from miscrosoft help
gt;
gt; support.microsoft.com/default...b;en-us;213360
gt;
gt; U need to customize it to your need.
gt;
gt;
gt;
gt; quot;Yaman Mahajanquot; wrote:
gt;
gt; gt; Hi,
gt; gt; I am Using Excel for my Billing Purposes, i want that excel print the amount
gt; gt; in words for Eg: if my total is 3,046.78 then i want excel print this numeric
gt; gt; digit in Ruppes Three Thousand Fourty Six amp; Paise Seventy Eight Only.

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()