count the number of characters in a range for specific styles

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

in a range, i need to count the number of characters

- in captio
- in hyperlin
- size>1
- bolde

Anyone knows, please hel
Thanks
 
jesse said:
in a range, i need to count the number of characters:

- in caption
- in hyperlink
- size>10
- bolded


Hi Jesse,

You can use "Edit > Replace" for this.
I guess you have selected the range you want the count for?

In the replace dialog, with the cursor in the "Find what" box, you'll find
"any character" under "More > Special". Click on that, and ^? should appear
in "Find what:".

With the cursor int the "Replace with" box, you can insert "Find what text"
= ^& in "Special".
This will replace the found text with itself. In effect, the replacement
doesn't change a thing. We just use it so the dialog will report the number
of "replacements".

Now back in "Find what", you can limit the replacement to a certain
formatting.
To look for captions only, choose the "Caption" style in "More > Format >
Style".
For hyperlinks, you'd use the "Hyperlink" style, and for "bolded", "Format >
Font > Bold".

There is no way to look for all font sizes above 10 pt in one go. If you
used styles, you should only have a couple different font sizes, and it
shouldn't be hard to add up the numbers for those > 10 pt.

If you have no idea at all what font sizes to look for, you'd need to check
the font size of each and every character in a macro. And that would be
terribly slow.
You'd better ask in a VBA group if you need to do that.

Regards,
Klaus
 
Back
Top