traducción inversa

How to count the number of words in Excel?

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:

Sub CountWords()
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
End If
WordCount = WordCount + N
Next Rng
MsgBox “Words In ActiveSheet Sheet: ” & Format(WordCount,”#,##0″)
End Sub

3. Then click doc-multiply-calculation-3 button to execute the code, and the number of the words will be displayed in the prompt box. See screenshot:


I hope it helps.

Financial Translator

Traducción financiera

light bulb icon:

Add Comment Register

Leave a Reply

Your email address will not be published. Required fields are marked *