raghuram.star
Board Regular
- Joined
- Sep 5, 2012
- Messages
- 102
Can you please help to compare text in two columns and hilight the differences in another column.
Example
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Old Text (Col A)
[/TD]
[TD]New Text (Col B)[/TD]
[TD]Comparision (Col C)[/TD]
[/TR]
[TR]
[TD]It was the humans who was sent to Moon first[/TD]
[TD]But later they said it was animals which was sent to Moon First.
[/TD]
[TD]But later they said it was animals which (the humans who) was sent to Moon First.
[/TD]
[/TR]
[TR]
[TD]Is it possible to compare the text in multiple lines
like this text is in seperate line
a cell in excel is free text8 and any one can tye any thing in it[/TD]
[TD]Can it possible to compare the texts in multiple lines.
could it be like this text is in seperate line?
This is completely new line of text in the cell which has no trace in the old text
Each cell in excel is free text9 and any onebody could tye any thing in it.[/TD]
[TD]Can (Is) it possible to compare the texts in multiple lines.
could it be like this text is in seperate lines?
This is completely new line of text in the cell which has no trace in the old text
Each (a) cell in excel is free text9 (text8) and anybody could (any one can) tye any thing in it.[/TD]
[/TR]
</tbody>[/TABLE]
Please help me.
I have below code by
I am a novice to VBA and I could not edit it for my need.
Please help me...

Example
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Old Text (Col A)
[/TD]
[TD]New Text (Col B)[/TD]
[TD]Comparision (Col C)[/TD]
[/TR]
[TR]
[TD]It was the humans who was sent to Moon first[/TD]
[TD]But later they said it was animals which was sent to Moon First.
[/TD]
[TD]But later they said it was animals which (the humans who) was sent to Moon First.
[/TD]
[/TR]
[TR]
[TD]Is it possible to compare the text in multiple lines
like this text is in seperate line
a cell in excel is free text8 and any one can tye any thing in it[/TD]
[TD]Can it possible to compare the texts in multiple lines.
could it be like this text is in seperate line?
This is completely new line of text in the cell which has no trace in the old text
Each cell in excel is free text9 and any onebody could tye any thing in it.[/TD]
[TD]Can (Is) it possible to compare the texts in multiple lines.
could it be like this text is in seperate lines?
This is completely new line of text in the cell which has no trace in the old text
Each (a) cell in excel is free text9 (text8) and anybody could (any one can) tye any thing in it.[/TD]
[/TR]
</tbody>[/TABLE]
Please help me.
I have below code by
Code:Const redCIndex As Long = 3 Const blackCIndex As Long = 0 Sub CheckAgainstColumnA() Dim oneCell As Range With ThisWorkbook.Sheets("Sheet1").Range("A:A"): Rem adjust For Each oneCell In Range(.Cells(1, 1), .Cells(.Rows.Count, 1).End(xlUp)) oneCell.Font.Color = blackCIndex oneCell.Offset(0, 1).Font.ColorIndex = blackCIndex Call highlightDifference(oneCell, oneCell.Offset(0, 1)) Call highlightDifference(oneCell.Offset(0, 1), oneCell) Next oneCell End With End Sub Sub highlightDifference(refCell As Range, testCell As Range) Dim refString As String, testString As String Dim i As Long, startPoint As Long, newPoint As Long testCell.Font.ColorIndex = redCIndex refString = refCell.Text testString = testCell.Text startPoint = 1 For i = 1 To Len(refString) newPoint = InStr(startPoint, testString, Mid(refString, i, 1)) If newPoint <> 0 Then testCell.Characters(newPoint, 1).Font.ColorIndex = blackCIndex startPoint = newPoint + 1 End If Next i End Sub
I am a novice to VBA and I could not edit it for my need.
Please help me...
Last edited: