There are a few ways to remove common values in Excel under different rows.
Using the Remove Duplicates feature:
Select the range of cells that you want to remove the common values from.
Click on the Data tab.
In the Data Tools group, click on the Remove Duplicates button.
In the Remove Duplicates dialog box, select the columns that you want to remove the duplicates from.
Click on the OK button.
Using the Advanced Filter feature:
Select the range of cells that you want to remove the common values from.
Click on the Data tab.
In the Sort & Filter group, click on the Advanced button.
In the Advanced Filter dialog box, select the Remove Duplicates option.
Select the columns that you want to remove the duplicates from.
Click on the OK button.
Using a VBA macro:
You can also use a VBA macro to remove common values in Excel under different rows. The following is a VBA macro that you can use:
VBA
Sub RemoveCommonValues()
' This macro removes common values in Excel under different rows.
Dim rng As Range
Dim i As Long
Dim j As Long
' Set the range of cells that you want to remove the common values from.
Set rng = Range("A1:B10")
' For each row in the range,
For i = 1 To rng.Rows.Count
' For each cell in the row,
For j = 1 To rng.Columns.Count
' If the value of the cell is already in the current row,
If rng(i, j).Value In rng(i, 1:j - 1) Then
' Remove the value from the cell.
rng(i, j).Value = ""
End If
Next j
Next i
End Sub
To use this macro, copy and paste it into a VBA module and then run the macro.
Markdown for AI
A clean, structured version of this page for AI assistants and LLMs.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
There are a few ways to remove common values in Excel under different rows.
Using the Remove Duplicates feature:
Using the Advanced Filter feature:
Using a VBA macro:
You can also use a VBA macro to remove common values in Excel under different rows. The following is a VBA macro that you can use:
VBA
To use this macro, copy and paste it into a VBA module and then run the macro.