Excel VBA find and replace regex

You can’t use regular expressions by writing an excel formula, but you can do it with a bit of VBA code. Follow these steps to add the proper reference in VBA and write a regular expression to find and replace data.

Open an Excel file and then VBA Editor (Left Alt + F11).

Choose Tools >> References.

Add Microsoft VBScript Regular Expression 5.5. If you don’t do it, Excel won’t recognize the code and will return an error.