View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Macro needed to delete rows

Try the following

Sub AAA()
Dim LastRow As Long
Dim RowNdx As Long
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
For RowNdx = LastRow To 2 Step -1
If Cells(RowNdx, "A") = Cells(RowNdx - 1, "A") Then
Rows(RowNdx).Delete
End If
Next RowNdx
End Sub

This assumes your data is in column A and starts in row 1.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"simmerdown" wrote in
message
...
I have a list of numbers that I want to narrow down to unique
numbers....in
other words, I want to delete the row if a number show is
already displayed
elsewhere.

Example list:

1
2
2
2
3
4
4
4

I am searching for a macro that will delete the rows containing
the extras
"2's" and "4's".