Erase dataa
a = 0
For i = 4 To Sheets("Visual ").Range("A65536").End(xlUp).Row
If Sheets("Visual ").Cells(i, 1) >= data(0, 0, 0) - 2 Then
a = a + 1
dataa(a, 1) = Sheets("Visual ").Cells(i, 4) 'brick.no
dataa(a, 2) = Mid(Sheets("Visual ").Cells(i, 5), 1, (InStr(1, Sheets("Visual ").Cells(i, 5), "/", vbTextCompare) - 1)) ' wire.no
dataa(a, 3) = Sheets("Visual ").Cells(i, 70) 'IHI
dataa(a, 4) = Sheets("Visual ").Cells(i, 76) 'table
End If
Next
ActiveWorkbook.Close False
For i = 1 To 7
For j = 3 To Sheets(i).Range("A65536").End(xlUp).Row
For k = 1 To a
If Sheets(i).Cells(j, 1) = Mid(dataa(k, 1), 6, 4) + "_" + Mid(dataa(k, 1), 11, 2) Then
Sheets(i).Cells(j, 12) = dataa(k, 2)
Sheets(i).Cells(j, 13) = dataa(k, 3)
Sheets(i).Cells(j, 14) = dataa(k, 4)
End If
Next
Next
Next
For i = 1 To 7
For j = 3 To Sheets(i).Range("D65536").End(xlUp).Row
If Right(Sheets(i).Cells(j, 13), 1) = 2 Then
Sheets(i).Cells(j, 4).Interior.Color = RGB(255, 0, 0)
Sheets(i).Cells(j, 5).Interior.Color = RGB(255, 0, 0)
Sheets(i).Cells(j, 1).Interior.Color = RGB(255, 0, 0)
End If
Next
Next