View Single Post
 
Old 08-02-2016, 07:36 AM
grumblid grumblid is offline Windows 7 64bit Office 2003
Novice
 
Join Date: Jul 2016
Posts: 25
grumblid is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
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 ^ ^'
Reply With Quote