What is the code snippet which can be, for example, the code below the cursor to scroll so that it is always in the places where the double occur. In the worksheet there is the first 5 rows which are locked and there is a button which is connected to the code so how to roll along the bottom lines so that it is always a line which is double the present?
Sub aaa()
Dim lngSel As Long
Range("A:A").Interior.ColorIndex = xlNone
For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
If WorksheetFunction.CountIf(Range("A1:A" & i), Cells(i, 1).Value) > 1 Then
Cells(i, 1).Interior.ColorIndex = 3
lngSel = MsgBox("Duplicate files...Do You want to delete", vbYesNoCancel)
If lngSel = vbCancel Then Exit Sub
If lngSel = vbYes Then
Cells(i, 1).EntireRow.Delete
Else
Cells(i, 1).Interior.ColorIndex = xlNone
End If
End If
Next i
End Sub
Sub aaa()
Dim lngSel As Long
Range("A:A").Interior.ColorIndex = xlNone
For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
If WorksheetFunction.CountIf(Range("A1:A" & i), Cells(i, 1).Value) > 1 Then
Cells(i, 1).Interior.ColorIndex = 3
lngSel = MsgBox("Duplicate files...Do You want to delete", vbYesNoCancel)
If lngSel = vbCancel Then Exit Sub
If lngSel = vbYes Then
Cells(i, 1).EntireRow.Delete
Else
Cells(i, 1).Interior.ColorIndex = xlNone
End If
End If
Next i
End Sub