I have a column filled with alphanumeric strings. Some of strings have long integers embedded in them. How do I replace the integers with a string of 'x' characters? For example:
- "this is account 123456789" becomes "this is account xxxxxxxxx"
- "please return item 999999999999 to storage" becomes "please return item xxxxxxxxxxxx to storage"
Note that:
- the digits can occur anywhere in the string including start, end or mid.
- the long integers are either 9-chars or 12-chars long
I am using Excel for Mac, V16. Since it is Mac, I do not have access to a RegExp object.
Mid(s, i, 1) Like "#"
- if yes then record the start position and keep looping till you hit a non-number character, then check the run length - if it's 9 or 12 than use (eg)Mid(s, pos, runLength) = String(runLength, "X")
- Tim Williams