Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Numbering / August 2005

Tip: Looking for answers? Try searching our database.

Tallying Characters Used

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Scot O - 24 Aug 2005 21:19 GMT
Is there a way to have Word tally the number of times individual characters
(letters, symbols, and numbers) are used in a selected passage?

TIA.
Doug Robbins - 24 Aug 2005 22:12 GMT
You may be able to use something like:

Dim i As Long, j As Long, arange As Range, Counter As Long, result As
Document
Set arange = Selection.Range
Set result = Documents.Add
For i = 65 To 255
   Counter = 0
   For j = 1 To arange.Characters.Count
       If Asc(arange.Characters(j)) = i Then
           Counter = Counter + 1
       End If
   Next j
   result.Range.InsertAfter Chr(i) & vbTab & Counter & vbCr
Next i

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Is there a way to have Word tally the number of times individual
> characters
> (letters, symbols, and numbers) are used in a selected passage?
>
> TIA.
Scot O - 24 Aug 2005 22:35 GMT
Thanks so much, Doug, for your help, but when I cut and paste your lines to
create a new macro, I get the message "Compile error:  Expected: New or type
name."

Am I doing something wrong?
Scot (scot@ober.net)

> You may be able to use something like:
>
[quoted text clipped - 17 lines]
> >
> > TIA.
Stefan Blom - 25 Aug 2005 10:29 GMT
Backspace before "Document" in the declaration statement (which starts
with "Dim") so that it doesn't wrap to a second line and then press
SpaceBar to reinsert the space.

Signature

Stefan Blom
Microsoft Word MVP

> Thanks so much, Doug, for your help, but when I cut and paste your lines to
> create a new macro, I get the message "Compile error:  Expected: New or type
[quoted text clipped - 24 lines]
> > >
> > > TIA.
Doug Robbins - 25 Aug 2005 19:21 GMT
Probably caused by linebreaks inserted by the mail program.  The following
should be all on one line:

Dim i As Long, j As Long, arange As Range, Counter As Long, result As
Document

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Thanks so much, Doug, for your help, but when I cut and paste your lines
> to
[quoted text clipped - 26 lines]
>> >
>> > TIA.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.