Monday, October 31, 2011

SPELLNUMBER IN EXCEL FOR INDIAN CURRENCY SYSTEM

Spell Indian numbering system in Excel with the help of SpellNumber function


1. Start Microsoft Excel.

2. Press ALT+F11 to start the Visual Basic Editor.

3. On the Insert menu, click Module.

4. Copy and paste the following into the module sheet and save



Function SpellNumber(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
SpellNumber = "Rupees "
ElseIf Val(Left(FIGURE, 9)) = 1 Then
SpellNumber = "Rupee "
End If
For i = 1 To 3
If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then
SpellNumber = SpellNumber & WORDs(Val(Left(FIGURE, 2)))
ElseIf Val(Left(FIGURE, 2)) > 19 Then
SpellNumber = SpellNumber & tens(Val(Left(FIGURE, 1)))
SpellNumber = SpellNumber & WORDs(Val(Right(Left(FIGURE, 2), 1)))
End If
If i = 1 And Val(Left(FIGURE, 2)) > 0 Then
SpellNumber = SpellNumber & " Crore, "
ElseIf i = 2 And Val(Left(FIGURE, 2)) > 0 Then
SpellNumber = SpellNumber & " Lakh, "
ElseIf i = 3 And Val(Left(FIGURE, 2)) > 0 Then
SpellNumber = SpellNumber & " Thousand, "
End If
FIGURE = Mid(FIGURE, 3)
Next i
If Val(Left(FIGURE, 1)) > 0 Then
SpellNumber = SpellNumber & WORDs(Val(Left(FIGURE, 1))) + " Hundred and "
End If
FIGURE = Mid(FIGURE, 2)
If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then
SpellNumber = SpellNumber & WORDs(Val(Left(FIGURE, 2)))
ElseIf Val(Left(FIGURE, 2)) > 19 Then
SpellNumber = SpellNumber & tens(Val(Left(FIGURE, 1)))
SpellNumber = SpellNumber & WORDs(Val(Right(Left(FIGURE, 2), 1)))
End If
FIGURE = Mid(FIGURE, 4)
If Val(FIGURE) > 0 Then
SpellNumber = SpellNumber & " and "
If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then
SpellNumber = SpellNumber & WORDs(Val(Left(FIGURE, 2)))
ElseIf Val(Left(FIGURE, 2)) > 19 Then
SpellNumber = SpellNumber & tens(Val(Left(FIGURE, 1)))
SpellNumber = SpellNumber & WORDs(Val(Right(Left(FIGURE, 2), 1)))
End If
SpellNumber = SpellNumber & " Paise"
End If
FIGURE = amt
FIGURE = Format(FIGURE, "FIXED")
If Val(FIGURE) > 0 Then
SpellNumber = SpellNumber & " Only "
End If
End Function

Wednesday, March 17, 2010

The Donkey, The Dog, The Monkey and the Man

The Donkey, The Dog, The Monkey and the Man

Short satirical humor on the life of a man.


God created the donkey and ordered: you will work tirelessly from dawn to dusk; you will be the beast of burden; you will eat grass; you have no intelligence; you are named as “Donkey” and you will have 50 years to live.

The monkey requested, “Oh Lord 50 years is too much, please grant me 20 years”. His plea was accepted.

God created the dog: You will be the man’s loyal and best friend; you will look after his house; whatever is left over by the man you will eat: You are named as “Dog” and you have 25 years to live.

The dog implored, “Oh Lord, 25 years is too much, please grant me just 10 years to live”. His wish was granted.

God created the monkey: You will hop from one tree to another; you will mimic, show tricks and entertain the man; you are named as “Monkey” and you have 20 years to live.

The monkey requested, “Oh Lord 20 years is too much for me, please grant me 10 years to live, and his wish was granted.

And then God created the man and said: You will be known as a Man; you are the only one out of the entire lot of species on this earth that has intelligence. Using your knowledge and intelligence you will become the master of the animals. You will rule the world and you have 20 years to live.

The man humbly begged, “O my Lord, you have given me the honorary status of being a man, but have allowed me only 20 years to live, which is too little Please allow me the 30 years left by the donkey, the 15 years which the dog has refused and 10 years which the monkey has declined..

His wish was granted…

So, the man spends 20 years as a man; then he gets married and lives like a donkey, carrying all the weight over his shoulders. When his children grow up, he then spends 10 years like a dog, looking after the house and eating whatever is given to him.

And as he gets old, he starts his retired life like a monkey. Hopping from one house to another, visiting his son or daughter, showing tricks like a monkey he entertains his Grandchildren.

Then he dies…

Friday, August 10, 2007

HOW A SON or DAUGHTER THINKS OF HIS

HOW A SON or DAUGHTER THINKS OF HIS/HER DADDY AT DIFFERENT AGES
At 4 Years My daddy is great.
At 6 Years My daddy knows everybody.
At 10 Years My daddy is good but is short tempered and knows little less than my friend's Daddy.
At 12 Years My daddy was very nice to me when I was young
At 14 Years My daddy is getting fastidious.
At 16 Years My daddy is not in line with the current times. Frankly he does not know anything.
At 18 Years My daddy is becoming increasingly cranky.
At 20 Years Oh! Its becoming difficult to tolerate daddy. Wonder how Mother puts up with him.
At 25 Years Daddy is objecting to everything. Don't know when he will understand the world.
At 30 Years It's becoming difficult to manage my son. I was so scared of my father when I was young.
At 40 Years Daddy brought me up with so much discipline. I wonder how he managed to handle the younger generation.
At 45 Years I am baffled as to how my daddy brought us up.
At 50 Years My daddy faced so many hardships to bring us up. (We were seven brothers and three sisters). I am unable to manage a single son.
At 55 Years My daddy was so far sighted and planned so many things for us. Even at this old age, he is able to control things. He is one of his kind and unique.
At 60 Years My daddy was great.
Thus, it took 56 years to complete the cycle and come back to the 1st stage! But alas he is no more with us so that we can tell it to them. So Don't waste time and Never forget your parents. Realise it in time