Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 05-28-2017, 12:22 AM
gmayor's Avatar
gmayor gmayor is offline remove rows without certain word Windows 10 remove rows without certain word Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

In that case
Code:
Sub Macro1()
Dim oPara As Paragraph
    For Each oPara In ActiveDocument.Paragraphs
        If InStr(1, oPara.Range.Text, "WAS") = 0 And _
           InStr(1, oPara.Range.Text, "WERE") = 0 Then
            oPara.Range.Delete
        End If
    Next oPara
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
remove rows without certain word How to remove blank spaces between rows in a table, Jamal NUMAN Word 2 04-28-2017 12:59 PM
remove rows without certain word Delete All empty Rows - Print - Undo all Rows deleted Bathroth Word VBA 1 10-01-2014 01:40 PM
remove rows without certain word Remove rows less than 10 gbaker Excel Programming 18 07-21-2014 04:51 AM
remove rows without certain word Grouping table rows to prevent individual rows from breaking across pages dennist77 Word 1 10-29-2013 11:39 PM
remove rows without certain word How to remove blank rows from a specified range? Learner7 Excel 1 04-19-2011 02:45 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:09 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft