Guessed, the code is working perfectly. I decided to do a few changes (please don't get mad at me).
1) I came back a little bit and decided to also keep the lines that contains the date (text typed) in the third column as well. I did this adding this condition inside this "If Not":
Code:
If Not (InStr(aRow.Cells(2).Range.Text, sText) > 0 Or InStr(aRow.Cells(3).Range.Text, sText) > 0) Then
aRow.Range.Font.Hidden = True
2) But now, I want to change the color (to red) of the rows that contains the word typed in the second column. I did like this:
Code:
Else
bHit = True
Set aCell = aRow.Cells(aRow.Cells.Count)
sRefs = sRefs & "|" & Split(aCell.Range.Text, vbCr)(0) 'builds a list of all the wanted refs
If (InStr(aRow.Cells(2).Range.Text, sText) > 0) Then
aRow.Range.Font.ColorIndex = wdRed
End If
End If
This seems to work, but I also want in the last table, to paint the reference "sRef" (in red) of the line that I'm changing the color (just if the date typed matchs in the second column). This I'm not sure how to do.
Again! Amazing Work. Your solution to go to the top of the screen seems to solve the problem of slowness. I just wondering if painting the rows it's too much for the software to handle.