Hello Bino1121View attachment 321
I need to convert this into VBA code.... The range I have set there isn't really 1048576 I just couldn't figure out how to set it as control+shift+down. and the cells that this applies to is from $A$4:$A$1048576
Sub AlternativeWayOfConditionalFormatting()
Dim ws1, ws2 As Worksheet
Dim i, lastRow As Long
Set ws1 = ThisWorkbook.Sheets("Sheet1")
Set ws2 = ThisWorkbook.Sheets("Sheet2")
lastRow = ws2.Cells(Rows.Count, 1).End(xlUp).Row
For i = 4 To lastRow
If ws1.Range("A2").Value = ws2.Range("A" & i).Value Then
ws1.Range("A2").Interior.Color = RGB(255, 255, 0)
End If
Next i
End Sub