I have the below code as part of a macro within Excel. I am needing help with the syntax (I think). In the .Replace, the "\4" is literally replacing the currentname. What I need is the \4 in regular expression, ie the 4th part of my pattern. They all work in Regex Coach, so I'm hoping I just don't know how to enter it in VBA. The Msgbox below returns "True".
Any assistance will be greatly appreciated.RegName = RegEx.Test(currentname) MsgBox RegName RegName = RegEx.Replace(currentname, "\4")