Code:
Sub Macro1() Dim num As Integer Dim scan As Integer Dim start As Integer Dim total As Integer start = 1 While Range("A" & start) <> "" start = start + 1 Wend total = start - 1 num = 1 For num = 1 To total For scan = (num + 1) To start While Range("A" & scan) = Range("A" & num) If Range("A" & scan) = Range("A" & num) Then Range("A" & scan).Delete shift:=xlUp End If Wend Next Next End Sub
The problem I'm having is that it goes into an endless loop. I've stepped through the code, and when it reaches "End Sub", the program starts again from the beginning of the code. I have no idea why this is happening. Any help is appreciated.
Comment