How to remove duplicate values from one cell to another

kevin2828

New Member
Joined
Feb 1, 2021
Messages
2
Office Version
  1. 2007
Platform
  1. Windows
I want to remove values from one duplicate cell to another
For example :
Column A Column B
15061670Duplicate
15061670Duplicate

I want to remove duplicate value from Column B and column A value remain same.

Please help
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
VBA Code:
Sub t()
Dim i As Long
    With ActiveSheet
        For i = .Cells(Rows.Count, 2).End(xlUp).Row To 2 Step -1
            If .Cells(i, 2).Value = .Cells(i - 1, 2).Value Then
                 .Cells(i, 2).ClearContents
            End If
        Next
    End With
End Sub
 
Upvote 0
Solution
VBA Code:
Sub t()
Dim i As Long
    With ActiveSheet
        For i = .Cells(Rows.Count, 2).End(xlUp).Row To 2 Step -1
            If .Cells(i, 2).Value = .Cells(i - 1, 2).Value Then
                 .Cells(i, 2).ClearContents
            End If
        Next
    End With
End Sub
It works like a charm.... Thank you.
 
Upvote 0

Forum statistics

Threads
1,215,359
Messages
6,124,488
Members
449,166
Latest member
hokjock

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