Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-21-2021, 05:08 PM
Peterson Peterson is offline Find and delet all text within brackets and the brackets themselves Windows 10 Find and delet all text within brackets and the brackets themselves Office 2019
Competent Performer
 
Join Date: Jan 2017
Posts: 143
Peterson is on a distinguished road
Default

It looks like every set of numbers in parentheses that you need to delete begins with ct., so you can delete those sets while leaving your totals with the following code:
Code:
Sub Test_Replace()
    With ActiveDocument.Content.Find
        .Text = "\(ct.*\)"
        .Replacement.Text = ""
        .ClearFormatting
        .Replacement.ClearFormatting
        .MatchWildcards = True
        .Execute Replace:=wdReplaceAll
    End With
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and delet all text within brackets and the brackets themselves Formatting text within brackets jimmi6jjr Word 4 10-04-2022 09:33 PM
Find and delet all text within brackets and the brackets themselves find and delet all text within brackets and the brackets themselves wrdy Word 2 08-03-2017 06:55 PM
Find and delet all text within brackets and the brackets themselves Find and Replace - How to insert brackets around all numbers in a doc Natedogg Word 2 05-21-2015 07:16 AM
Microsoft Word macro to find text, select all text between brackets, and delete helal1990 Word VBA 4 02-05-2015 03:52 PM
Find and delet all text within brackets and the brackets themselves Find/Replace Brackets Problem fatso Word 2 08-04-2011 11:34 AM

Other Forums: Access Forums

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