Monday, December 23, 2019

How to convert Number into Words in Microsoft Excel

Brief Introduction


            There is not any specific Microsoft Excel function which will convert a number into words. Instead, we need to create a custom function through Microsoft Visual Basic for Applications (VBA) to convert the number into words. Let's explore how. To see the completed custom function and how it is used & work see in the example below,

Purpose:

Convert Number into Words.



You can download free the Complete Practice of Concern Topic of Microsoft Excel File & VBA Code, Click on the below download icon,


          
              This article explains in simple terms how to convert number into words. It takes a step-by-step approach, & following below contents we will touch in this post.
  1. How to Convert Number into Words in Microsoft Excel.

Let’s start to learn something new about Microsoft Excel VBA.    
            
1.  How to Convert Numbers into Words in Microsoft Excel.

             Let's get started. First, we'll need to open our Microsoft Excel spreadsheet and then press "Alt + F11" to open the "Microsoft Visual Basic for Applications window", then we should insert a Module in the workbook, so by two ways we can add module,
First Right-click on "Thisworkbook" then click on Insert and last click on Module, as shown in below image,


The second way through which we add a module in our workbook is under the "Insert Menu", click on Module.


When the module is inserted in our the workbook then copy the VBA Code which we have prepared for the purpose to convert Number into words and "paste" it in the module, as shown in below example, 


After that hold the keys "Ctrl + S" to save the file, if your file already saved in macro-enabled file type then it will save the file automatically, otherwise, it will warn that there are macros in the spreadsheet & we will need to enable the macros for the function to work properly, so in that case, click on "NO" button. 


After clicking on "No" button, the window of "Save As" will open then change the "file name" & "location" we want to save the file, & "save as types" which should be "Excel Macro-Enabled Workbook" & then click on "Save" button,


 As our file will be saved in proper location then closed the "Microsoft Visual Basic for Applications Window" (VBA) by holding of keys "Alt + F4" & check our "VBA Code" which is working properly, as shown below image,


Explanation: - In the above given example, we see that column "B" contains the numbers & Column "E" contains the custom function which we have created in our current spreadsheet file through VBA Code. The selected cell "E8" show how the custom function, the Number "$9,823.32/-" converted exactly into words "Nine Thousand Eight Hundred Twenty Three USD and Thirty-Two Cents",

In this scenario, we have used custom function like below,
=SpellNumber(B8)

The above example was for the currency of "USD", but we can change the currency from "USD" to "EUR" or "any other currency" by holding the keys of "Ctrl + H" which open the window of "Find and Replace" option, as shown in the below image,


Explanation: - Write in blank "Find what" the word "USD" and in "Replace with", write the word "EUR" or "any country’s Currency abbreviation" then click on "Replace All" button, it will replace according to your requirement, so then copy the complete "VBA Code" & repeat the above all procedure, as we will get our target.
Enjoy the Microsoft Excel VBA Code….. 


No comments:

Post a Comment