I am looking for a regex for excel 2007 that can replace all instances of -3 ONLY at the end of the string, replacing it with absolutely nothing (removing it). There are instances of -3 throughout the strings, however I need to remove only the ones at the end. This is being integrated into a macro, so find and replace using a single regex is preferred.
Share
You can do this without
Regexby using VBA’sInstrfunction. Here is the code:Update
Based on Juri’s comment below, changing the If statement to this will also work, and it’s a bit cleaner.