I was given this code to help me on a worksheet that has duplicates. The code (I think) takes the current row and compares it to the row above to see if it is a duplicate and if so clears it. Then it loops through until all rows have been reviewed and cleaned up. The code however is giving me an error and since I don't know VBA (only enough to be dangerous) I can't fix it. With all of you guru's I know someone will have the answer. Here is the code:
---------------------------------------
Sub CleanUnwantedRows()
Range("Q65536").End(x1Up).Select
Do Until ActiveCell = 2
If ActiveCell.Value = ActiveCell.Offset(-1, 0).Value Then
ActiveCell.ClearContents
End If
ActiveCell.Offset(-1, 0).Select
Loop
End Sub
--------------------------------------------
I'm get error "Application-defined or object-defined error" on the first line.
Hope that I've explained this enough and someone can help me.
Thanks . . .