I´m trying to compare two sentences in differente cells and show the difference in red.
I´m using a code that has a problem. Is comparing the position of each letter. When it finds a difference it shows it in red which is fine. The problem is that if a word is changed with a word with a different amount of letters, the rest of the sentence also appears in red.
As an example:
In this picture you can see that after a word is found, the rest of the words also appear as different even though they are the same.
This is the code that I´m currently using:
Sub Compare()
For i = 1 To Len(ActiveSheet.Range("F1").Value)
If (ActiveSheet.Range("F1").Characters(i, 1).Text <> ActiveSheet.Range("G1").Characters(i, 1).Text) Then
ActiveSheet.Range("F1").Characters(i, 1).Font.Color = RGB(255, 0, 0)
End If
Next i
End Sub
Also, this code is one working on the selected cell, I need it to work with the entire column (F and G).
Thanks in advanced
I´m using a code that has a problem. Is comparing the position of each letter. When it finds a difference it shows it in red which is fine. The problem is that if a word is changed with a word with a different amount of letters, the rest of the sentence also appears in red.
As an example:
In this picture you can see that after a word is found, the rest of the words also appear as different even though they are the same.
This is the code that I´m currently using:
Sub Compare()
For i = 1 To Len(ActiveSheet.Range("F1").Value)
If (ActiveSheet.Range("F1").Characters(i, 1).Text <> ActiveSheet.Range("G1").Characters(i, 1).Text) Then
ActiveSheet.Range("F1").Characters(i, 1).Font.Color = RGB(255, 0, 0)
End If
Next i
End Sub
Also, this code is one working on the selected cell, I need it to work with the entire column (F and G).
Thanks in advanced