Hi guys,

I have been the code below in many a different form since royUK first helped me find a certain value and delete the entire row. I've used it to find values, text, multiple conditions and so on and so forth, but I cannot figure out how to compare the cell to the cell directly above.


Set rng = Range(Cells(1, 2), Cells(Rows.Count, 2).End(xlUp))
    X = rng.Rows.Count
    For R = X To 1 Step -1
        If Cells(R, 5) = 12 Then Cells(R, 5).EntireRow.Delete
    Next R
What I am looking to do is replace the 12 in bold above with 'the cell directly above'. I've tried things with offset and various other ways, but I am obviously not knowledgeable enough. Could someone help me?