Hello,
Are you sure you need a VBA solution for this? It's possible to do this with conditional formatting and it would probably be way faster than VBA.
You can check the unicode of each character in the string. If you're not familiar with unicode, look up a unicode character map.
If you look at the map, "normal" characters are from 0 to about 127. So if we can check each character to see if it falls outside of that range, then we'll flag it with red highlighting.
Let's say your text is in column B. We need to add a column with an array formula to pick up which cells have the condition we're looking for.
I'm modifying a formula I found on another website. It's pretty complicated, but basically it looks at every character, one-by-one, and check to see if it is within range of "normal" characters.
Put this formula in column A:
=SUM(IF(CODE(MID(B1,(ROW(OFFSET($B$1,,,LEN(B1)))),1))>127,1,0))
Be sure to enter the formula by pressing CTRL+SHIFT+ENTER to make it an array formula.
Then you can make a conditional format on column B based on the results of column A. Select Column B and open up the conditional formatting manager. Choose to enter a formula and put this formula in there:
=A1>=1
Hope this helps.




Reply With Quote

Bookmarks