Reputation: 3527
I have a column with 3 of the same keywords taking up 3 rows. I need to clear the values in the first two rows in each instance.
I have highlighted the rows as an example in the screenshot:
Thanks for your time and help!
Upvotes: 1
Views: 250
Reputation: 12495
Here is vba Function that will remove duplicates and does not shift the value up
Option Explicit
Sub ClearDuplicates()
Dim i As Long
Dim lRng As Long
lRng = Range("A65536").End(xlUp).Row
For i = lRng To 1 Step -1
If Application.WorksheetFunction.CountIf(Range("A1:A" & i), _
Range("A" & i).Value) > 1 Then
Range("A" & i).ClearContents
End If
Next i
End Sub
Example
Upvotes: 0
Reputation: 37135
Use Remove Duplicates
excel built in command. Under Data
tab you will find remove duplicates command.
(1) First select desired column of range.
(2) Hit on Remove Duplicates.
(3) Follow the on screen instructions and do as necessary.
Upvotes: 0
Reputation: 197
You might want to try the below:
On the Home Tab, Click
This will highlight all the duplicates in Pink(Default Color). You can then Filter by Color. Copy the unduplicated data and paste into another column.
Upvotes: 1
Reputation: 692
If you want to replace the duplicate keywords with blanks, you can make a new column to the right of your Keyword column and use an IF-function =IF(B2=B1,"",B2)
. If you copy that down, your original Keyword column will be copied except the duplicates will be blank.
Upvotes: 1