![]() |
#1
|
|||
|
|||
![]()
I have a problem which I am battling to solve. I am wondering if someone has done something similar:
I have several documents which contain strings such as: 1. Word$n:m (n and m being one, two or three digit numbers) 2. Word$n (as above) 3. x$Word$n:m (x = 1, 2 or 3) 4. x$Word$n (x = 1, 2 or 3) Word being any word appearing in an array of words. The words are case sensitive. $ = a non-breaking space As each occurrence is found I need to replace the non-breaking space with a normal space. Thank you in advance for any assistance. |
#2
|
|||
|
|||
![]()
If you use a space in the find box, it should find the non-breaking space. Replace it with a space character and you should have accomplished what you want.
Is there a reason this is posted in the vba forum rather than the general Word forum? If not, I can move it there. |
#3
|
|||
|
|||
![]() Quote:
The reason why I put it here is that there are some 130 different possibilities of the words, so I was hoping to do it with VBA, rather than a word at a time with a find/replace. |
#4
|
||||
|
||||
![]()
You could, of course use a wildcard Find/Replace, where:
Find = ([A-Z][a-z]@)^s([0-9]) Replace = \1 \2 This would leave the non-breaking spaces before your 'Word' intact. If you're wedded to removing those, too, do a second wildcard Find/Replace, where: Find = ([0-9])^s([A-Z][a-z]@ [0-9]) Replace = \1 \2
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
Tags |
non-breaking-space, replace, vba |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Non-breakable space to have same width as usual space | dum | Word | 5 | 09-14-2020 03:49 AM |
![]() |
frankjake | Word | 8 | 09-21-2018 05:44 PM |
![]() |
normancamp | Word | 10 | 12-25-2017 04:54 PM |
![]() |
seanspotatobusiness | Word | 8 | 03-09-2017 05:09 AM |
![]() |
gpr | Word | 2 | 07-10-2015 06:44 AM |