Help in combining two macros to work as one

J

Jackie Damrau

I have the following two macros that I need to combine into one which I want
to delete two lines throughout a document. Each line starts with "(Contact
Network: <variable text>)" and "(Status: <variable text>)". These work great
separately, but not together.

Can someone please show me how to combine these to work as one?
-----
Sub RemoveContact()
'
' RemoveContact Macro
' Macro created 8/12/2004 by jackie.damrau
'
Dim oRng As Range
ResetSearch
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = "(Contact Network:"
While .Execute
oRng.Paragraphs(1).Range.Delete
Wend
End With
ResetSearch
End Sub
Sub RemoveStatus()
'
' RemoveStatus Macro
' Macro created 8/12/2004 by jackie.damrau
'
Dim oRng As Range
ResetSearch
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = "(Status:"
While .Execute
oRng.Paragraphs(1).Range.Delete
Wend
End With
ResetSearch
End Sub
 
A

Alex Ivanov

What do you mean by "Not together"? Do you receive any error messages?
Paste the contents of the second macro from the line
"Set oRng = ActiveDocument.Range" up to "ResetSearch" into the end of the
first one
before "End Sub" and it should work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top