View Single Post
  #6   Report Post  
Greg
 
Posts: n/a
Default Apply a macro to a specified Cell

Abel,

Did you try it? What do you think?

I don't think so, because before the .Execute statement you have only
changed your mind twice regarding what text you want to find and what
you want that text replaced with.

This would work:

Sub Test1()
Dim myRng As Range
Set myRng = ActiveDocument.Tables(1).Cell(2, 1).Range
With myRng.Find
.Text = "uncle"
.Replacement.Text = "favorit uncle"
.Execute Replace:=wdReplaceAll
.Text = "nefew"
.Replacement.Text = "favorit nefew"
.Execute Replace:=wdReplaceAll
.Text = "sista"
.Replacement.Text = "favorit sista"
.Execute Replace:=wdReplaceAll
End With
End Sub