How do I insert characters in the message?

Hello everyone,

I want to put the $ symbol when I see the character X.

Original text --> Test!X2:X20
Text required --> Test!$X$2:$X$20

can you help me

Thanks.
Apollo

replaceString.xaml (4.0 KB)

@Perawat

1 Like

Hi,

It seems string for worksheet address.

The following will work in any relative address.

System.Text.RegularExpressions.Regex.Replace(text,"(?<=!)([A-Z]+)(\d+):([A-Z]+)(\d+)","$$$1$$$2:$$$3$$$4")

Regards,

2 Likes

Thanks! It was helpful.

If I want results like this by adding the letter M

Original text --> Test!X2:X20:M1!M30
Text required --> Test!$X$2:$X$20:$M$1!$M$30

Thanks.
Apollo

1 Like

replaceString.xaml (5.7 KB)

Try this @Perawat

Will try… Thanks:)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.