![visual basic in excell visual basic in excell](https://www.en-excel.com/wp-content/uploads/2017/07/Visual_Basic.png)
‘* MyNumber = Numeric Value you need to convert into words *
![visual basic in excell visual basic in excell](https://www.codeguru.com/wp-content/uploads/2021/07/Excel1.png)
‘* User can define the Prefix and Sufix place for Currency and CurrencyDecimals * ‘* This modified UDF can be used for any currency in case you provide for currency inputs * ‘* UDF modified on Septemto make currency inputs optional, by default it will use Indian Currency * ‘* Based on SpellNumbers UDF by Microsoft, Which handles only Dollars as currency * Optional M圜urrencyDecimalsPlace As String = “S”) Optional M圜urrencyDecimals As String = “Paisa”, _ Optional M圜urrencyPlace As String = “P”, _ Optional M圜urrency As String = “Rupee”, _ Str = Str & " " & FnGetUnitDigit(Right(intN, 1 )) Str = FnGetUnitDigit(Left(intN, 1 )) & " Hundred " & FnGetTensDigit(Right(intN, 2 )) Str = FnGetHundreds(Right(intN, Len(intN) – 1 )) Str = FnGetUnitDigit(Left(intN, 1 )) & " Thousand " & FnGetHundreds(Right(intN, Len(intN) – 1 )) 'Str = FnGetUnitDigit(Left(intN, 1)) & " Thousand " & FnGetHundreds(Right(intN, Len(intN) – 1)) Str = FnGetHundreds(Right(intN, Len(intN) – 2 )) Str = FnGetTensDigit(Left(intN, 2 )) & " Thousand " & FnGetHundreds(Right(intN, Len(intN) – 2 )) 'Str = FnGetTensDigit(Left(intN, 2)) & " Thousand " & FnGetHundreds(Right(intN, Len(intN) – 2)) Str = FnGetThousandsTwo(Right(intN, Len(intN) – 1 )) Str = FnGetUnitDigit(Left(intN, 1 )) & " Lac " & FnGetThousandsTwo(Right(intN, Len(intN) – 1 )) 'Str = FnGetUnitDigit(Left(intN, 1)) & " Lac " & FnGetThousandsTwo(Right(intN, Len(intN) – 1)) Str = FnGetThousandsTwo(Right(intN, Len(intN) – 2 )) Str = FnGetTensDigit(Left(intN, 2 )) & " Lacs " & FnGetThousandsTwo(Right(intN, Len(intN) – 2 )) Str = FnGetLacsTwo(Right(intN, Len(intN) – 1 )) Str = FnGetUnitDigit(Left(intN, 1 )) & " Crore " & FnGetLacsTwo(Right(intN, Len(intN) – 1 )) Str = FnGetLacsTwo(Right(intN, Len(intN) – 2 )) Str = FnGetTensDigit(Left(intN, 2 )) & " Crores " & FnGetLacsTwo(Right(intN, Len(intN) – 2 )) Str = FnGetHundreds(Left(intN, 3 )) & " Crores " & FnGetLacsTwo(Right(intN, Len(intN) – 3 )) Str = FnGetThousandsOne(Left(intN, 4 )) & " Crores " & FnGetLacsTwo(Right(intN, Len(intN) – 4 ))
![visual basic in excell visual basic in excell](https://cdn.wallstreetmojo.com/wp-content/uploads/2019/06/VBA-Tutorial.jpg)
Str = FnGetThousandsTwo(Left(intN, 5 )) & " Crores " & FnGetLacsTwo(Right(intN, Len(intN) – 5 )) Str = FnGetLacsOne(Left(intN, 6 )) & " Crores " & FnGetLacsTwo(Right(intN, Len(intN) – 6 )) ' Str = FnGetLacsTwo(Right(intN, Len(intN) – 3)) Str = FnGetLacsTwo(Left(intN, 7 )) & " Crores " & FnGetLacsTwo(Right(intN, Len(intN) – 7 )) If Len(strDecimal) > 0 And Len(strDecimal) 1 And Len(strDecimal) 0 And Len(strNumber) 1 And Len(strNumber) 2 And Len(strNumber) 3 And Len(strNumber) 5 And Len(strNumber) 7 And Len(strNumber) "" Then If InStr( 1, strNumber, ".", vbTextCompare) > 0 Then MainWorkBook.Sheets( "Main" ).Range( "B" & i) = FnConvert(intValue) IntValue = mainWorkBook.Sheets( "Main" ).Range( "A" & i)