A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Hi. Just an idea to your excellent code.
It would adjust 6 or more digits, or something that was very tall (ie 12345")
One idea might be to isolate the 5-digit within a word boundary, and not followed by the double quote to represent inches. Quotes are not part of a word boundary.
I might factor Global and Pattern out of the loop.
Here's what I was thinking...
( [^\u0022] -> Not the Unicode 22 character, which is Double Quotes)
With regExp
.Global = True
'/ 5 digit word boudary not followed by double quotes
.Pattern = "\b\d{5}\b[^\u0022]"
For Each rngCel In Worksheets("Sheet1").UsedRange
rngCel.Value = .Replace(rngCel.Value, "this ")
Next rngCel
End With