![]() ![]() ![]() XArr_1 = Array("Ten ", "Eleven ", "Twelve ", "Thirteen ", "Fourteen ", "Fifteen ", "Sixteen ", "Seventeen ", "Eighteen ", "Nineteen ") XRStr = xRStr & GetTenDigits(Mid(xStrNum, 2, 2), xBB)įunction GetTenDigits(xTDgt, xB As Boolean) XRStr = GetDigits(Mid(xStrNum, 1, 1)) & "Hundred " XNumber = Left(xNumber, Len(xNumber) - 3)įunction GetHundredsDigits(xHDgt, xB As Boolean) XT = GetHundredsDigits(Right(xNumber, 3), True) XT = GetHundredsDigits(Right(xNumber, 3), False) If (Len(Str(xNumber)) Mod 3) = 0 Then xLen = xLen - 1 XStrPoint = Left(xStr, Len(xNumber) - xDP) VBA code: Convert numbers to words Function NumberstoWords(ByVal MyNumber) Click Insert > Module and paste the following macro in the Module Window. Press the Alt + F11 keys in Excel, and it opens the Microsoft Visual Basic for Applications window.Ģ. Save and Use the VBA Code in All Workbooksįor example, you want to use the VBA code to convert numbers to English words and save the VBA module in all workbooks in case you want to use the VBA code in the future.
0 Comments
Leave a Reply. |