Why is this locking up? Loop through all rows, perform function on duplicate, delete duplicate row
The code works when I bite off a couple hundred rows at a time, but always hangs somewhere in the middle when I try to run it on 10,000. What the code does: Looks for duplicate entries in column A, adds the values in columns c, d and e between the two rows, then deletes the original row. Can anybody think of a more stable way to do this, or point me towards why it might be locking up? Sub combineDelete () Const TEST_COLUMN As String = "A" Dim i As Long Dim iLastRow As Long With ActiveSheet iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row For i = iLastRow To 2 Step -1 If Cells(i, 1) =