tombaraider
Technical User
Sorry for not making things clearer in my previous posts and my explanation as to why the problem has not been solved would be too wordy. So I apologize for my previous posts on this and truly appreciate previous input. I finally have this macro perfected like I want. The macro was created in Word and once a document is opened it arrows down twice, finds the word "REPORT", and once it's found, close search window, cursor up one line and press End key to get to the end of that line then Ctrl-Enter to force a page break. Please tell me exactly what and where to put it into this macro to make it keep running until the end of the file and stop. Thank you so much. Here is the code:
Sub Macro1()
'
' Macro1 Macro
'
'
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "REPORT"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.EndKey Unit:=wdLine
Selection.InsertBreak Type:=wdPageBreak
Selection.MoveDown Unit:=wdLine, Count:=2
End Sub
Sub Macro1()
'
' Macro1 Macro
'
'
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "REPORT"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.EndKey Unit:=wdLine
Selection.InsertBreak Type:=wdPageBreak
Selection.MoveDown Unit:=wdLine, Count:=2
End Sub