Is there a word-count macro in excel?

  • Thread starter Thread starter Jack Crane
  • Start date Start date
J

Jack Crane

Word has a built-in word-count macro. Does excel?

A friend needs to find the total of all the words in an excel document.

Thanks,

Jack Crane
 
Nope.

Jack said:
Word has a built-in word-count macro. Does excel?

A friend needs to find the total of all the words in an excel document.

Thanks,

Jack Crane
 
FWIW:
Found this in Google:
Paste into Standard Module

Sub AAA()
Dim WordCount As Long
Dim cell As Range
Dim S As String
Dim N As Long
For Each cell In ActiveSheet.UsedRange.Cells
S = cell.Text
N = 0
If S <> "" Then
N = 1
End If
WordCount = WordCount + N
Next cell
MsgBox WordCount
End Sub

Hope this helps;
 
Hi Jim,
Looks like an adaptation of Chip's macro attempting to count the number
of cells that are not empty.
 
Yeah you're right guys,
I got in a hurry, particularly after I tried Chip's original
code and with six words spread over only 4 cells,
the count came back 14; ???

My attempt to help went "down-hill" from there.
Sorry OP..
Tks,
 
Back
Top