Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-21-2023, 02:31 AM
chidamla chidamla is offline Replace text using Macro in MS Word 2021 Windows 10 Replace text using Macro in MS Word 2021 Office 2021
Novice
Replace text using Macro in MS Word 2021
 
Join Date: Apr 2023
Posts: 1
chidamla is on a distinguished road
Default Replace text using Macro in MS Word 2021

Scan through the complete document for Text: "+40 deg C'



Replace + with - only if it is followed by a number. Dont replace if - is followed by a non-number.

Regular expression is required to find the matches.

Please share a Macro for the same.
Reply With Quote
  #2  
Old 04-21-2023, 04:53 AM
gmayor's Avatar
gmayor gmayor is offline Replace text using Macro in MS Word 2021 Windows 10 Replace text using Macro in MS Word 2021 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,106
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 of
Default

Find +([0-9])
Replace with -\1
with the wildcard option checked. You can record the search for a macro.
__________________
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
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace text using Macro in MS Word 2021 how to replace a text in word by cell value (bulleted text) using macro Gowri Word VBA 8 03-26-2017 04:14 AM
Replace text using Macro in MS Word 2021 Macro to find text and replace with form field containing that text iiiiifffff Word VBA 16 06-04-2016 01:47 AM
Replace text using Macro in MS Word 2021 Macro to search warning text style and replace the text color rohanrohith Word VBA 3 11-27-2014 01:08 PM
Macro to find coloured text and replace with form-field/formtext containing that text tarktran Word VBA 1 11-26-2014 08:12 AM
Replace text using Macro in MS Word 2021 Word VBA Macro to Find and Replace based on the Alt Text of an Image bennymc Word VBA 1 01-27-2014 04:23 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:23 AM.


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