I have the following UDF that spells numbers to words and it is working very well ... but I would like to make one slight change if possible.
Code: Select all
Sub SpellNumbersToLetters()
Dim Sh As Worksheet, LR As Long, Cel As Range
Dim Stx1 As String, Stx2 As String, St1 As String, St2 As String, Texte1 As String, Texte2 As String
For Each Sh In Worksheets(Array("data"))
LR = Sh.Cells(Sh.Rows.Count, 1).End(xlUp).Row
Stx1 = "Dollars ": Stx2 = "Cents ": St1 = "and ": St2 = "No non"
Texte1 = Ar_WriteDownNumber(Int(Sh.Cells(LR, "T")))
Texte2 = Ar_WriteDownNumber(100 * Sh.Cells(LR, "T") Mod 100)
With Sh.Cells(LR + 1, "B")
If 100 * Sh.Cells(LR, "T") Mod 100 = 0 Then
.Value = "Only " & Texte1 & Stx1 & St2
Else
.Value = "Only " & Texte1 & Stx1 & St1 & Texte2 & Stx2 & St2
End If
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sh.Range(Sh.Cells(LR + 1, "A"), Sh.Cells(LR + 7, "B")).ClearContents
Next Sh
End Sub
Please see the attachment file ... Thank you in advance