Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88030

Delete Duplicated with Right function

$
0
0

I'm looking for a macro to delete duplicates in a column, regarding their last value e.g.

DES_FFAs_556
asda_FRF_556

Because 556 is same, it should be deleted.

right now im getting the last 4 digits of each cell but i dont know how to remove duplicates with it

Sub duplicates()

Dim i As Long
Dim res As String
Dim WB As Workbook
Dim WS As Worksheet
Dim total As Long

Set WB = Workbooks("MQB37W - SW Architecture Matrix_Nw")
Set WS = WB.Sheets("SW Architecture Main - In...")

With WS
total = .Cells(Rows.Count, 1).End(xlUp).Row

For i = 4 To total
res = Right(Cells(i, "A").Value, 4)
WS.Range("A4:total").RemoveDuplicates Columns:=1, Header:=xlNo


Next
End With
End Sub


``

Viewing all articles
Browse latest Browse all 88030

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>