View Single Post
 
Old 10-29-2021, 10:05 AM
davidjm davidjm is offline Windows 10 Office 2016
Novice
 
Join Date: Jun 2018
Posts: 18
davidjm is on a distinguished road
Default how do I replace string 123-4 with 123 4

Hi,
I have a word doc and some vb code that increments all numeric values by 2, so for example value 123-4 should return 125-6, but what I receive is 125-4. I tried :
text = Replace(text, "-", " ") but the text value doesn't change. Replacing other values works as expected.
How can I replace '-' between 2 numbers with space so that both numbers are incremented.
This is part of an index I'm trying to update, but the index was created manually and not using any of the Word indexing options
Any help much appreciated
Reply With Quote