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.

Column A Column B
çarçar
yekone
sethree
pencpenc

<colgroup><col><col></colgroup><tbody>
</tbody>


as result it must be so:
Column A Column B
yekone
sethree

<colgroup><col><col></colgroup><tbody>
</tbody>

<tbody>
</tbody>


----
i have office plus 2010

<colgroup><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
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,216,028
Messages
6,128,400
Members
449,448
Latest member
Andrew Slatter

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