View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Ronald[_4_] Ronald[_4_] is offline
external usenet poster
 
Posts: 14
Default Search Word document based on text in Excel cell.

Thanks Isabelle!

I've tried it but without success.
I think it's not really jumping to Word to find the text isn't it?

I've used the following code:

Sub MacroIsab()
Dim keywords As String, c As Range, n As Integer
keywords = "verliep" ' adapt
With Worksheets(1).Range("a1:a500")
Set c = .Find(keywords, LookIn:=xlValues, LookAt:=xlPart)
If Not c Is Nothing Then
firstAddress = c.Address
Do
n = Application.Find(keywords, c)
With c.Characters(Start:=n, Length:=Len(keywords))
.Font.Color = RGB(255, 0, 0)
End With
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress

End If
End With
End Sub