Remove duplicate cell value and not the actual cell.

joyguru

New member
Joined
Jan 22, 2019
Messages
9
Reaction score
0
Points
0
Excel Version(s)
2007, 2010
How to keep the first value of duplicate in a column and delete others (without moving blank cell) using vba excel.

If I have a row like

Untitled.png

After I run macro I want
Untitled2.png
 
try:
Code:
Sub blah()
Set Rng = Range("E11:E21") 'this is the range of cells you want to process.
For Each cll In Rng.Cells
  If Application.CountIf(Range(Rng.Cells(1), cll), cll.Value) > 1 Then cll.ClearContents
Next cll
End Sub
 
If you just don't want to see the value, you could use conditional formatting over A1:A11 with a formula of =COUNTIF($A$1:$A1,$A2) and set the font colour to white.
 
Back
Top