Vbscript - String comparison which highlights actual differences
Posted on 2010-09-23
I would assume that this may be a very difficult function to code. I'm looking for a function in vbscript to compare two strings and highlight the actual difference in red (within an excel cell).
For example, I have two strings:
For this example, it would color TP=1.8 in the first string red because it does not exist in the second string.
I would assume that the inputs for the function would be each row and column for the two cells as well as the sheet. But I really don't care if you need the inputs to be something different, I can change my code to work with it.
The function would search the two strings and highlight the exact letters that are missing or different from each.
Another example would be:
For this example, it would highlight "KLM" and "JRK" because they are different between the two strings.
I'm constantly having to make this comparison myself for thousands of lines and human error is very high. I'm pretty good at coding but this one has me stumped!!
Many, Many thanks to the person that figures this out!