Software

Convert a numeric value into English words in Microsoft Excel

Microsoft Excel does not ship with a function that will convert a numeric value into English words. However, there is a user-defined function that will perform that service.

Problem

For whatever reason, Microsoft Excel does not come with a built-in function that will convert numeric values into English words. The ability to make such a conversion is necessary for the successful operation of several potential Excel applications. This is the dilemma that faced karansoin when he/she asked for help in the TechRepublic Technical Q&A forum.

Solution

Microsoft has published a rather lengthy user-defined function that will perform this conversion. To apply the function to your worksheet, you open the Excel Visual Basic Editor, which is found in the Tools | Macros menu. After opening the editor, open a new module by navigating to Insert | Module in the menu toolbar.

Once you're in a blank module, you should copy the code in Listing A to the Windows clipboard and paste it into the module. (See Figure A.)

Figure A

Code snippet

An example

Once the code is in place and you save it in the current worksheet, you'll have access to the SpellNumber() function, which will convert to English any value passed to it. This user-defined function comes in handy for several applications, including our example—printing a check. Figure B shows a simple check writing worksheet that takes the information input into A2, B2, and C2 and places it in the corresponding cells that make up our printable check.

Figure B

Check printing

The key to the example is the SpellNumber() function located in cell C13. With some layout adjustments configured for your particular laser printer and the use of micro-encoding toner, you could conceivably use this worksheet to print checks. Of course, there is still plenty of room for improvement to the worksheet in terms of linking to customer information, accounts payable, check registers, etc., but the basic concept is sound.

Next Steps: Build your skills with these hand-picked resources
> MSKB 213360-XL2000: How to Convert a Numeric Value into English Words
> MSKB 140704- How to Convert a Numeric Value into English Words
> Microsoft Visual Basic for Applications home page
> Sort and format a protected Excel worksheet with a macro

About

Mark Kaelin is a CBS Interactive Senior Editor for TechRepublic. He is the host for the Microsoft Windows and Office blog, the Google in the Enterprise blog, the Five Apps blog and the Big Data Analytics blog.

0 comments

Editor's Picks