'3
If Worksheets("max").Range("C3").Value = Worksheets("sheet").Range("B1").Value Then
Worksheets("max").Range("C3").Value = Worksheets("sheet").Range("B3").Value
Worksheets("max").Range("С3").Interior.Color = vbGreen
ElseIf Worksheets("max").Range("C3").Value = Worksheets("sheet").Range("C1").Value Then
Worksheets("max").Range("C3").Value = Worksheets("sheet").Range("C3").Value
Worksheets("max").Range("С3").Interior.Color = vbRed
End If
'4
If Worksheets("max").Range("C4").Value = Worksheets("sheet").Range("B1").Value Then
Worksheets("max").Range("C4").Value = Worksheets("sheet").Range("B4").Value
Worksheets("max").Range("С4").Interior.Color = vbGreen
ElseIf Worksheets("max").Range("C4").Value = Worksheets("sheet").Range("C1").Value Then
Worksheets("max").Range("C4").Value = Worksheets("sheet").Range("C4").Value
Worksheets("max").Range("С4").Interior.Color = vbRed
End If
'5
If Worksheets("max").Range("C5").Value = Worksheets("sheet").Range("B1").Value Then
Worksheets("max").Range("C5").Value = Worksheets("sheet").Range("B5").Value
Worksheets("max").Range("С5").Interior.Color = vbGreen
ElseIf Worksheets("max").Range("C5").Value = Worksheets("sheet").Range("C1").Value Then
Worksheets("max").Range("C5").Value = Worksheets("sheet").Range("C5").Value
Worksheets("max").Range("С5").Interior.Color = vbRed
End If
Set WBMax = thisworkbook.worksheets("max")
Set WBSheet = thisworkbook.worsheets("sheet")
If WBMax.Cells(1,3).Value = WBMSheet.Cells(1,2).Value Then
WBMax.Cells(3,3).Value = WBMSheet.Cells(3,2).Value
WBMax.Cells(3,3).Interior.Color = RBG(1,1,1)