Thread: Macro or VBA
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don[_21_] Don[_21_] is offline
external usenet poster
 
Posts: 5
Default Macro or VBA

Gail,

How about:

Sub DeleteDupRows()
With ActiveSheet
For iRow = 100 To 2 Step -1 'change 100 to last row
If Cells(iRow, 1) = Cells(iRow - 1, 1) Then
Cells(iRow, 1).EntireRow.Delete
End If
Next iRow
End With
End Sub

Don Pistulka


"GAIL HORVATH" wrote in message ...
I hane a column in a spread sheet whose values at times are repeats of the cell above. I want that row deleted if the value is the same as the cell above is there a way to do it programaticallY?

e.g.
A B C D E
Acct # MedRec# field field field
112233 xxx xxx xxx xxx
112233 xxx xxx xxx xxx
123123 xxx xxx xxx xxx
123412 xxx xxx xxx xxx
123412 xxx xxx xxx xxx

I would want the rows in bold red deleted

--
Gail M Horvath