Quote:
Originally Posted by Guessed
Try a macro like this to highlight any paragraphs that contain the string provided by the user.
Code:
Sub HighlightHits()
Dim aPara As Paragraph, sFind As String
sFind = LCase(InputBox("What are we looking for today?", "Finder", "Office"))
ActiveDocument.Range.HighlightColorIndex = wdNoHighlight
For Each aPara In ActiveDocument.Paragraphs
If InStr(LCase(aPara.Range.Text), sFind) > 0 Then
aPara.Range.HighlightColorIndex = wdDarkYellow
End If
Next aPara
End Sub
|
Thank you, this is almost exactly what I had in mind! You are awesome~
I take the blame though, because I forgot that highlight was a thing you can do on Word, and I used that term here when I should've said 'select.' I apologize
Is it possible to make a macro that does just as the one you posted does, except instead of highlighting those areas it 'selects' them, allowing you to use 'cut' and 'copy' on all those areas at once? That's what I've been after all this time ^ ^'