I am just learning vba in excel. I am stuck with a problem here.
What i am trying accomplish here is
- Select values in Sheet1 ColumnB when Sheet1 ColumnC is empty.
- Take those values and compare them with sheet2 ColumnO.
- Sheet1 ColumnB values is green in sheet1 when common with sheet2 ColumnO values.
- Sheet1 ColumnB values is yellow in sheet1 when it is not common with sheet2 ColumnO values.
- sheet2 ColumnO values is red in sheet2 when its not in sheet1.
here is the sample file
https://a.uguu.se/tkGV68TzIGwR_testtt111.xlsx
This is what i got so far. I can select the values in ColumnB when columnC is empty and copy them in to another column.
Sub compareWR()
Dim emptyI As Long
Dim emptyJ As Long
lastrow = ws1.Cells(Rows.Count, "B").End(xlUp).Row
emptyJ = 2
For emptyI = 2 To lastrow
If Cells(emptyI, "C").Value = "" Then
Cells(emptyJ, "AA").Value = Cells(emptyI, "B").Value
emptyJ = emptyJ + 1
End If
Next emptyI
End Sub