![]() |
|
#1
|
||||
|
||||
![]() hi icsjohn, Try the following macro. It counts from the start of the selected range and doesn't care whether the current selection is more, or less, than the desired word count. Code:
Sub Demo() Dim i As Long i = InputBox("How many words do you want to select?", "Word Marker") With Selection While .Range.ComputeStatistics(Statistic:=wdStatisticWords) < i .MoveEnd wdWord, i - .Range.ComputeStatistics(Statistic:=wdStatisticWords) Wend End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
Tags |
highlight, macro, word count |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
flackend | Mail Merge | 4 | 12-01-2023 02:49 PM |
![]() |
kimsi | Word | 3 | 11-15-2011 11:54 PM |
![]() |
Jamal NUMAN | Word | 24 | 07-24-2011 04:39 PM |
![]() |
zsmithku | Word | 1 | 04-15-2011 03:46 PM |
Why Words doesn’t show the style of the selected words automatically???? | Jamal NUMAN | Word | 0 | 04-14-2011 03:20 PM |