title: How to look for repeated rows and then delete one of them?
body: <p>I was wondering if anyone knows how to delete repeated rows.. Say for example,</p>
  <pre><code>   A        B       C
  
  1  1        3       4
  2  2        6       9
  3  TEST     1       2
  4  TEST     1       2
  5  Both     1
  6  Hi               2
  7  None     3       3
  8  Loud     4       4
  </code></pre>
  <p>For the particular example above, TEST was repeated twice.. In some other cases, the name can be some other kinds such as NOON, Morning, etc.. And row 8 does not necessary be the last row.
  I have no idea of how to compare the rows to check for repeated names and then delete them away. I need to run a macro with this and so i will need VBA. If you know it, please share it with me.. Will be thankful!</p>
  <p>Attempt for codes:</p>
  <pre><code>Sub Macro1()
      Dim LastRow As Long, n As Long, rowstodelete As Long
  
      LastRow = Worksheets(&quot;Sheet1&quot;).Range(&quot;A&quot; &amp; Rows.Count).End(xlUp).Row
  
      For n = 1 To LastRow
  
          With Worksheets(&quot;Sheet1&quot;).Cells(n, 1)
              If .Cells(n, 1) = .Cells(n + 1, 1) Then
                  rowstodelete = Worksheets(&quot;Sheet1&quot;).Cells(n, 1)
                  Rows(rowstodelete).Select
                  Selection.Delete Shift:=xlUp
              End If
          End With
      Next n
  End Sub
  </code></pre>
  <p>Unfortunately, there were runtime error over at the .Cells(n, 1).. I have no idea why it is.. if you know something can share with me or modify it alittle. will be thankful!</p>