Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-18-2023, 01:24 PM
ctviggen ctviggen is offline Search/replace numbers so that XYY becomes ZYY Windows 10 Search/replace numbers so that XYY becomes ZYY Office 2016
Advanced Beginner
Search/replace numbers so that XYY becomes ZYY
 
Join Date: Feb 2021
Posts: 54
ctviggen is on a distinguished road
Default Search/replace numbers so that XYY becomes ZYY

Hi All,


I'd like to do a search/replace so that XYY becomes ZYY. For instance, 100 becomes 200, 110 becomes 210, 120 becomes 220, etc. That is, only the first number is changed and the other two are left alone.


I've tried using wildcards for this, but it doesn't seem to work in the ways I used.





I've also looked here for useful tools, but I cannot find the correct tool:


Finding and replacing characters using wildcards


(This is where I got the wildcard idea, though.)



Any help is appreciated, thank you.
Reply With Quote
  #2  
Old 09-18-2023, 01:27 PM
kilroyscarnival kilroyscarnival is offline Search/replace numbers so that XYY becomes ZYY Windows 10 Search/replace numbers so that XYY becomes ZYY Office 2021
Expert
 
Join Date: May 2019
Posts: 345
kilroyscarnival is just really nicekilroyscarnival is just really nicekilroyscarnival is just really nicekilroyscarnival is just really nice
Default

Are the numbers scattered throughout a regular Word document within paragraphs, or within a table or tabbed list?
Reply With Quote
  #3  
Old 09-18-2023, 01:41 PM
East East is offline Search/replace numbers so that XYY becomes ZYY Windows 10 Search/replace numbers so that XYY becomes ZYY Office 2019
Novice
 
Join Date: Aug 2023
Posts: 7
East is on a distinguished road
Default

With "Use wildcards" checked, Find what:
<1([0-9][0-9])>
Replace with:
2\1
Reply With Quote
  #4  
Old 09-21-2023, 11:48 AM
ctviggen ctviggen is offline Search/replace numbers so that XYY becomes ZYY Windows 10 Search/replace numbers so that XYY becomes ZYY Office 2016
Advanced Beginner
Search/replace numbers so that XYY becomes ZYY
 
Join Date: Feb 2021
Posts: 54
ctviggen is on a distinguished road
Default

Hi All, thank you for those replies. The numbers are scattered throughout the document and are references to figures (in a completely different document).


I think East solved it, thank you very much! I tested this on a paragraph, and it worked exactly as planned.



If I can interpret this, what is in ([0-9][0-9]) becomes \1 in the "replace".



And, for any number X-- you want to replace to Y--, this would become:


With "Use wildcards" checked, Find what:
<X([0-9][0-9])>
Replace with:
Y\1



Thanks, again.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
wildcard search and add (not replace) sequential numbers in front equalizer88 Word VBA 4 05-07-2016 08:04 PM
Search a cell that contains words and numbers and convert the numbers to metric Carchee Excel Programming 36 10-08-2014 03:16 PM
search and replace a field containing text and numbers H28Sailor Word 6 09-11-2014 01:00 AM
Search/replace numbers so that XYY becomes ZYY search and replace dirkoo Word VBA 2 08-14-2013 11:25 AM
Search and Replace - Clear Search box JostClan Word 1 05-04-2010 08:46 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:01 PM.


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