Is there a word-count macro in excel?

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
 
D

Dave Peterson

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
 
J

Jim May

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;
 
D

David McRitchie

Hi Jim,
Looks like an adaptation of Chip's macro attempting to count the number
of cells that are not empty.
 
J

Jim May

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top