I tried to use this in as a Excel macro and it removes the wrong data from sheet (Org). Can someone tell me what is wrong with it?
Column D in Sheet "Org" is compared/matched to Column C in Sheet "oldna". If a value in Org matches a value in oldna it should delete the row in Org. Right now it deletes the row before the one that needs to be deleted. I have tried taking out Step -1 but that doesn't do anything at all.
Dim sr1 As Long
Dim sr2 As Long
For sr1 = Sheets("Org").Range("D2").CurrentRegion.Rows.Count To 2 Step -1
For sr2 = 1 To Sheets("oldna").Range("c2").CurrentRegion.Rows.Count
If Sheets("Org").Cells(sr1, 2).Value = Sheets("oldna").Cells(sr2, 1).Value Then