View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Deleting Rows where some Cells have same Content

Sub DeleteDups()
Dim i As Long

i = 2
Do While Not IsEmpty(Cells(i, 1))
If Cells(i, 1) = Cells(i - 1, 1) And _
Cells(i, 2) = Cells(i - 1, 2) And _
Cells(i, 3) = Cells(i - 1, 3) Then
Cells(i, 1).EntireRow.Delete
Else
i = i + 1
End If
Loop
End Sub

--
Regards,
Tom Ogilvy





"JamesT" wrote in message
...
Hello

I am after a Macro that will delete rows where information is the same in
defined columns.... I have data that is similar to the following, but

extends
across several comumns, but I only want to conern the macro with the first

3
colums for instance:

Name Book Language

James Flowers French
James Flowers French
James Flowers German

Name Book Language

James Flowers French
James Flowers German

I want it to leave me with, can anyone help with a VB Macro?

thanks