deleting same rows on two columns

osmanoca

Board Regular
Joined
Apr 16, 2016
Messages
87
hello i couldnt remove these same cells on two columns

i have A and B columns of dictionary database. some meaning in column B are same with word of column A. so this is a problem. column B ise meaning and it must be different. so i want to delete these black dublicated words below with macro. Please help me, i tried to delete dublicated function in office but it doesnt delete this kind.

[TABLE="width: 301"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Column A [/TD]
[TD]Column B[/TD]
[/TR]
[TR]
[TD]çar[/TD]
[TD]çar[/TD]
[/TR]
[TR]
[TD]yek[/TD]
[TD]one[/TD]
[/TR]
[TR]
[TD]se[/TD]
[TD]three[/TD]
[/TR]
[TR]
[TD]penc[/TD]
[TD]penc
[/TD]
[/TR]
</tbody>[/TABLE]


as result it must be so:
[TABLE="width: 301"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Column A [/TD]
[TD]Column B[/TD]
[/TR]
[TR]
[TD][TABLE="width: 301"]
<tbody>[TR]
[TD][TABLE="width: 301"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]yek[/TD]
[TD]one[/TD]
[/TR]
[TR]
[TD]se[/TD]
[TD]three[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]

----
i have office plus 2010[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
try this

Code:
Sub deleDupes()
Dim i As Long
With ActiveSheet
    For i = .Cells(Rows.count, 1).End(xlUp).Row To 2 Step -1
        If .Cells(i, 1).Value = .Cells(i, 1).Value Then .Cells(i, 1).Resize(1, 2).Delete xlShiftUp
    Next
End With
End Sub
 
Last edited:
Upvote 0
this macro deleted all cells sorry.


try this

Code:
Sub deleDupes()
Dim i As Long
With ActiveSheet
    For i = .Cells(Rows.count, 1).End(xlUp).Row To 2 Step -1
        If .Cells(i, 1).Value = .Cells(i, 1).Value Then .Cells(i, 1).Resize(1, 2).Delete xlShiftUp
    Next
End With
End Sub
 
Upvote 0
Hia
try
Code:
Sub deleDupes()
Dim i As Long
With ActiveSheet
    For i = .Cells(Rows.count, 1).End(xlUp).Row To 2 Step -1
        If .Cells(i, 1).Value = .Cells(i, [COLOR=#ff0000]2[/COLOR]).Value Then .Cells(i, 1).Resize(1, 2).Delete xlShiftUp
    Next
End With
End Sub
the item in red was wrong
 
Upvote 0
Thank you very much dear Fluff. it worked.
thanks.....


Hia
try
Code:
Sub deleDupes()
Dim i As Long
With ActiveSheet
    For i = .Cells(Rows.count, 1).End(xlUp).Row To 2 Step -1
        If .Cells(i, 1).Value = .Cells(i, [COLOR=#ff0000]2[/COLOR]).Value Then .Cells(i, 1).Resize(1, 2).Delete xlShiftUp
    Next
End With
End Sub
the item in red was wrong
 
Upvote 0
Hia
try
Code:
Sub deleDupes()
Dim i As Long
With ActiveSheet
    For i = .Cells(Rows.count, 1).End(xlUp).Row To 2 Step -1
        If .Cells(i, 1).Value = .Cells(i, [COLOR=#ff0000]2[/COLOR]).Value Then .Cells(i, 1).Resize(1, 2).Delete xlShiftUp
    Next
End With
End Sub
the item in red was wrong

Good catch on the typo, Fluff. Thanks.
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,629
Members
452,661
Latest member
Nonhle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top