ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Is there a word-count macro in excel? (https://www.excelbanter.com/excel-discussion-misc-queries/76706-there-word-count-macro-excel.html)

Jack Crane

Is there a word-count macro in excel?
 
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

Dave Peterson

Is there a word-count macro in excel?
 
Nope.

Jack Crane wrote:

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


--

Dave Peterson

David McRitchie

Is there a word-count macro in excel?
 
Hi Jack,
See Chip's macro for one worksheet, it is looking at text, which
is what you see not formulas and not values.
.. http://www.cpearson.com/excel/WordCount.htm
--
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm



Jim May

Is there a word-count macro in excel?
 
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;


"Jack Crane" wrote in message
6...
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




David McRitchie

Is there a word-count macro in excel?
 
Hi Jim,
Looks like an adaptation of Chip's macro attempting to count the number
of cells that are not empty.



Chip Pearson

Is there a word-count macro in excel?
 
That will count only the number of cells which contain text. It
doesn't take into account that a cell may contain more than one
word. For a real word counter, see
http://www.cpearson.com/excel/wordcount.htm .


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Jim May" wrote in message
news:07JQf.238819$oG.65444@dukeread02...
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;


"Jack Crane" wrote in message
6...
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






Jim May

Is there a word-count macro in excel?
 
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,


"Chip Pearson" wrote in message
...
That will count only the number of cells which contain text. It doesn't
take into account that a cell may contain more than one word. For a real
word counter, see http://www.cpearson.com/excel/wordcount.htm .


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Jim May" wrote in message
news:07JQf.238819$oG.65444@dukeread02...
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;


"Jack Crane" wrote in message
6...
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









All times are GMT +1. The time now is 06:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com