![]() |
|
#1
|
|||
|
|||
|
I used the below code to count the no. of words in sentences. If no. of words is greater than 20 then it should highlight it. I used the below code. It's just coloring the background. I want to just highlight it just like spell checker. please help.
Code: Sub Count_of_words() ' ' Count Macro ' ' Dim s As Range For Each s In Selection.Sentences If s.Words.count > 20 Then s.HighlightColorIndex = wdYellow Next End Sub |
| Tags |
| word vba, word vba highlight text, word vba macro |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Spell checker problem! | KEMYST | Word | 2 | 12-29-2014 04:57 AM |
Spell checker in Word protected forms
|
Frankwlc | Word | 3 | 08-02-2013 12:15 PM |
Macro to highlight text between 2 points in word 2010
|
jsilva1950 | Word VBA | 2 | 04-25-2013 12:21 AM |
| Spell checker keeps getting disabled | Jennifer Murphy | Word | 0 | 03-08-2012 06:20 AM |
spell checker trouble!
|
kennystringer | Word | 6 | 12-28-2011 11:41 AM |