Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 11-20-2017, 03:04 PM
gmaxey gmaxey is offline Finding Symbols And Deleting Text Before And After It Windows 7 32bit Finding Symbols And Deleting Text Before And After It Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,636
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey, http://gregmaxey.com/word_tips.html, 11/20/2017
Dim oRng As Range
  Set oRng = ActiveDocument.Range
  oRng.InsertBefore vbCr
  With oRng.Find
    .Text = "([^13^11])(*): "
    .MatchWildcards = True
    .Replacement.Text = "\1"
    .Execute Replace:=wdReplaceAll
  End With
  Set oRng = ActiveDocument.Range
  With oRng.Find
    .Text = " -*(^^)"
    .MatchWildcards = True
    .Replacement.Text = "\1"
    .Execute Replace:=wdReplaceAll
  End With
  ActiveDocument.Paragraphs(1).Range.Delete
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
finding 'struck-through' text joebloggs Word 1 08-16-2017 10:27 PM
Finding Symbols And Deleting Text Before And After It Inserting Symbols and Keeping Text Aligned- THANK YOU! StuartS Word 1 07-21-2016 10:00 PM
Finding Symbols And Deleting Text Before And After It Finding the nth Blank Value in a Row of Text ljg713 Excel 7 01-12-2016 07:49 AM
Finding Symbols And Deleting Text Before And After It symbols beside text like in onenote? symbolgirl Word 3 04-20-2012 01:44 AM
Finding Symbols And Deleting Text Before And After It text changes to symbols EMAW 2010 Word 4 03-25-2010 12:32 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:20 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