SOLVED

Find and Replace Macro with Mask

Copper Contributor

Hi,

 

I'm new to VBA macros, but most commands I understand.

Now I need something in a expert level, so if anyone can help me, it would be much appreciated.

 

I need to find and replace a random number with this format: 12.345/67 

to this: 12.345 de 67. Basicly I have to substitute the slash to " de ". 

So the compiler has to keep the number at the exact same order, just changing that.

 

I know how to find this, by using ^# or ?

The thing is the replace text box won't accept special characters such as those, and won't understand the correct numbers, even if I would use special characters.

2 Replies
best response confirmed by cindix (Copper Contributor)
Solution

@cindix Use a Wildcard Replace routine searching for 

 

([0-9]{2}.[0-9]{3})\/([0-9]{2})

 

and replacing it with

 

\1 de \2

 

Doug_Robbins_Word_MVP_0-1674071751280.png

 

@Doug_Robbins_Word_MVP 

 

Hey there! Thank you! You, Sir, have saved my life!

1 best response

Accepted Solutions
best response confirmed by cindix (Copper Contributor)
Solution

@cindix Use a Wildcard Replace routine searching for 

 

([0-9]{2}.[0-9]{3})\/([0-9]{2})

 

and replacing it with

 

\1 de \2

 

Doug_Robbins_Word_MVP_0-1674071751280.png

 

View solution in original post