Count the number of words with an easy code
Here is a very practical advise for translators and proofreaders who need to count the number of words in Excel. It is easy (more than formulas that depending on the version and the default language sometimes work and sometimes doesn’t) and helped me a lot. You only need to follow this step by step:
With the following code, you can quickly count the words in a cell and a range.
1. Select the cell or the range that you want to count the number of the words.
2. Click Developer>Visual Basic, a new Microsoft Visual Basic for applications window will be displayed, click Insert > Module, and input the following code into the Module:
Dim WordCount As Long
Dim Rng As Range
Dim S As String
Dim N As Long
For Each Rng In ActiveSheet.UsedRange.Cells
S = Application.WorksheetFunction.Trim(Rng.Text)
N = 0
If S <> vbNullString Then
N = Len(S) – Len(Replace(S, ” “, “”)) + 1
WordCount = WordCount + N
MsgBox “Words In ActiveSheet Sheet: ” & Format(WordCount,”#,##0″)
3. Then click button to execute the code, and the number of the words will be displayed in the prompt box. See screenshot:
I hope it helps.
light bulb icon: http://iconleak.com