Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 11-02-2013, 08:55 PM
fumei fumei is offline Deleting lines above selected text Windows 7 64bit Deleting lines above selected text Office XP
Expert
 
Join Date: Jan 2013
Posts: 440
fumei is on a distinguished road
Default

One way (there are alternatives) would be:
Code:
Sub RemoveAboveBX()
Dim oPara As Paragraph
For Each oPara In ActiveDocument.Paragraphs
   If InStr(oPara.Range.Text, "BX") > 0 Then
      oPara.Previous.Range.Delete
   End If
Next
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to find text in between two characters and then format selected text? qcom Word 5 02-19-2015 11:23 PM
Deleting grid lines but keeping the axis lines CoffeeNut Excel 0 04-01-2013 01:50 PM
Importing selected lines from a txt file Pedgonc Excel 2 01-09-2013 12:44 PM
Deleting lines above selected text Deleting Lines Pulls Back Next Page SQLUSA Word 5 12-18-2012 03:53 PM
Deleting empty lines lostsoul62 Word 5 04-16-2012 04:55 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:15 PM.


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