![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Location: Fort Worth
Posts: 13
|
I have 3 columns of information which has several rows ....what I need is something that will delete the duplicated rows that contain the same information in each column.....I have done a search and could not find what I needed .........
Help |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
|
Just replace the numbers in top of code do indicate which columns you want to test
Code:
Sub DeleteRow()
Col1 = 1 ' 1 = colA
Col2 = 2 ' 2 = colb
Col3 = 3 ' 3 = colC
For Rw = 1 To Cells.End(xlDown).Row
If Not (Cells(Rw, Col1).Value = "") And _
Cells(Rw, Col1).Value = Cells(Rw, Col2).Value And _
Cells(Rw, Col2).Value = Cells(Rw, Col2).Value Then
Cells(Rw, Col1).EntireRow.Delete
Rw = Rw - 1
End If
Next
End Sub
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Southfield,MI USA
Posts: 1,027
|
Hey,
In addition to Nimrods vba soln, you could also use an Advance Filter approach(checking the "unique records only") Adam |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|