1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
'AAAA
For j = 0 To LastRow1 - 1
Sheets("Errors").Activate
NbrCharacters = Len(Sheets("Errors").Cells(4 + j, Col(1)))
CellToLook = Left(Sheets("Errors").Cells(4 + j, Col(1)), NbrCharacters - 2)
If IsError(Application.VLookup((CellToLook & "*"), Range(Cells(4, Col(2)), Cells(4 + LastRow2, Col(2))), 1, False)) And IsError(Application.VLookup((CellToLook & "*"), Range(Cells(4, Col(3)), Cells(4 + LastRow3, Col(3))), 1, False)) And IsError(Application.VLookup((CellToLook & "*"), Range(Cells(4, Col(4)), Cells(4 + LastRow4, Col(4))), 1, False)) Then
Cells(4 + j, Col(1)).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
Next j
'BBBB
For j = 0 To LastRow2 - 1
Sheets("Errors").Activate
NbrCharacters = Len(Sheets("Errors").Cells(4 + j, Col(2)))
CellToLook = Left(Sheets("Errors").Cells(4 + j, Col(2)), NbrCharacters - 2)
If IsError(Application.VLookup((CellToLook & "*"), Range(Cells(4, Col(1)), Cells(4 + LastRow1, Col(1))), 1, False)) And IsError(Application.VLookup((CellToLook & "*"), Range(Cells(4, Col(3)), Cells(4 + LastRow3, Col(3))), 1, False)) And IsError(Application.VLookup((CellToLook & "*"), Range(Cells(4, Col(4)), Cells(4 + LastRow4, Col(4))), 1, False)) Then
Cells(4 + j, Col(2)).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
Next j
'CCCC
For j = 0 To LastRow3 - 1
Sheets("Errors").Activate
NbrCharacters = Len(Sheets("Errors").Cells(4 + j, Col(3)))
CellToLook = Left(Sheets("Errors").Cells(4 + j, Col(3)), NbrCharacters - 2)
If IsError(Application.VLookup((CellToLook & "*"), Range(Cells(4, Col(2)), Cells(4 + LastRow2, Col(2))), 1, False)) And IsError(Application.VLookup((CellToLook & "*"), Range(Cells(4, Col(1)), Cells(4 + LastRow1, Col(1))), 1, False)) And IsError(Application.VLookup((CellToLook & "*"), Range(Cells(4, Col(4)), Cells(4 + LastRow4, Col(4))), 1, False)) Then
Cells(4 + j, Col(3)).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
Next j
'DDDD
For j = 0 To LastRow4 - 1
Sheets("Errors").Activate
NbrCharacters = Len(Sheets("Errors").Cells(4 + j, Col(4)))
CellToLook = Left(Sheets("Errors").Cells(4 + j, Col(4)), NbrCharacters - 2)
If IsError(Application.VLookup((CellToLook & "*"), Range(Cells(4, Col(2)), Cells(4 + LastRow2, Col(2))), 1, False)) And IsError(Application.VLookup((CellToLook & "*"), Range(Cells(4, Col(3)), Cells(4 + LastRow3, Col(3))), 1, False)) And IsError(Application.VLookup((CellToLook & "*"), Range(Cells(4, Col(1)), Cells(4 + LastRow1, Col(1))), 1, False)) Then
Cells(4 + j, Col(4)).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If |
Partager