I have two sheets Report and Stat. I need to match cell from Report with Stat and Stat with report.
I don't know what I'm missing :(
I try to loop with For
, If
, IF Not
Sub Test1()
Dim x As Integer
Application.ScreenUpdating = False
Rows = Range("A1", Range("A1").End(xlDown)).Rows.Count
Range("A2").Select
For x = 1 To Rows
If ActiveCell.Value = Stat.Range("A").Value Then ActiveCell.Offset(0, 11).Value = "Old"
If Not ActiveCell.Value = Stat.Range("A").Value Then ActiveCell.Offset(0, 11).Value = "New"
' Selects cell down 1 row from active cell.
ActiveCell.Offset(1, 0).Select
Next
Sheets("Stat").Select
Rows2 = Range("A1", Range("A1").End(xlDown)).Rows.Count
Range("A2").Select
For x = 1 To Rows2
If Not ActiveCell.Value = Report.Range("A").Value Then ActiveCell.Offset(0, 11).Value = "Cleared"
' Selects cell down 1 row from active cell.
ActiveCell.Offset(1, 0).Select
Next
Application.ScreenUpdating = True
End Sub
I need to match all cells in column A and try to match with any cell in column A in Stat Sheet.
If it match then offset 11 cell Report sheet to the right and add value "Old" to the cell. If it doesn't match then Off offset 11 cell in Report sheet to the right and add value "New".
The last thing I need to match all cells in column A from Stat Sheet and try to match with any cell in column A in Report Sheet.
If it match then nothing If it doesn't match then sheet Stat offset 11 to the right and add value "Cleared"
I'm still looking working on this but can't figure it out :/