Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 05-20-2022, 12:21 AM
ranjan ranjan is offline Numbers Removal in a brackets Windows 10 Numbers Removal in a brackets Office 2019
Advanced Beginner
Numbers Removal in a brackets
 
Join Date: May 2021
Posts: 80
ranjan is on a distinguished road
Default

Hi Macropod,

Its working fine but am facing small issue with this code. code is completely removing the text within the brackets having numbers..

Ex: If total is presented in negative value then its completely deleting the total value..

I want to delete the text having +,- or both combination withint the brackets.

Total (2345,99) This shouldnt be removed, but my code was removing the total value also, is there any possibility to remove text in the brackets having +,- or both combination.

Input:

ABC (1255+3456-211+4332)
DEF (123+456+678)
GHI (123-456-678)
TOTAL (123,456)

Output:

ABC
DEF
GHI
TOTAL (123,456)

Could you please review the below one:

Code:
Sub Test_Replace()
    With ActiveDocument.Content.Find
        .Text = "\(*\)"
        .Replacement.Text = ""
        .ClearFormatting
        .Replacement.ClearFormatting
        .MatchWildcards = True
        .Execute Replace:=wdReplaceAll
    End With
End Sub
Your Help is Highly Appreciated...
Reply With Quote
 

Tags
numbers removal



Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2019: How to display the sign of numbers in another field in brackets? Jamal NUMAN Excel 3 09-16-2021 09:44 AM
Numbers Removal in a brackets Need Wild Card for Deleting Square Brackets with Differing Numbers inside CrossReach Word 6 11-26-2019 01:02 PM
Numbers Removal in a brackets Bold numbers between square brackets jeffreybrown Word 4 02-13-2017 04:32 PM
Numbers Removal in a brackets Help with: Replace and reformat numbers inside square brackets johnbrowny Word 1 02-13-2016 06:45 PM
Numbers Removal in a brackets Find and Replace - How to insert brackets around all numbers in a doc Natedogg Word 2 05-21-2015 07:16 AM

Other Forums: Access Forums

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