- Press ALT + F11 in Excel to open the VBA console
- Copy and add this module
- The function will be available in the Workbook
Function RegxFunc takes as arguments:
- strInput As String => The content to be matched
- regexPattern As String => The pattern to be matched against
- insertBefore As String => The content to be inserted before the matched text
- insertAfter As String => The content to be inserted after the matched text