1

please tell me whether it is possible to perform a replacement in a string that combines several different substitutions using VBA (excel)?

For example:

text = Replace(text, find1, res1)
text = Replace(text, find2, res2)

Real example:

text = Replace(text, " ", " ")
text = Replace(text, "&", "&")
text = Replace(text, "&lt", "<")

Maybe regexp?

1
  • Yes, you can do exactly like your examples show -- use three statements. Unless there are more details that you left out... Commented Nov 19, 2017 at 15:29

1 Answer 1

1

Nest them:

Text = Replace(Replace(Replace(Text, "&nbsp;", " "), "&amp;", "&"), "&lt", "<")
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.