I created a macro in Word 2010, by recording and then editing it in VB. But it only ran once. It's stored in the normal template and is visible when I view macros in any other document. But it won't run. Nothing happens when I view and then attempt to run it.
When I run it initially it works perfectly. Here's the code, in case that helps:
Sub RemoveRequirements()
'
' RemoveRequirements Macro
' Remove all requirements table titles and tables from a document.
'
Selection.Find.ClearFormatting
With Selection.Find
.Text = "requirements"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
While Selection.Find.Found
Selection.Find.Execute
Selection.HomeKey Unit:=wdLine
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Cut
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Tables(1).Select
Selection.Cut
Wend
End Sub