I'm trying to get this macro to work. I've wasted so much time. Can someone let me know if it's possible? I'm trying to delete certain words but only from a specified table and column. The selection works but then fails after the first word. Any Ideas?
Sub DeleteMultipleWords()
Dim arr() As Variant
Dim i As Byte
'Sub PrepareForKeyWordSearch()
j = InputBox("Which Table?")
l = InputBox("Which Column?")
selection.Tables(j).Columns(l).Select
selection.Find.ClearFormatting
selection.Find.Replacement.ClearFormatting
arr = Array("for", "and", "not", "nor", "but", "or")
For i = LBound(arr) To UBound(arr)
With selection.Find
.Text = arr(i)
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
End With
selection.Find.Execute Replace:=wdReplaceAll
Next
End Sub