I am trying to understand how to make a macro in Excel that eliminates duplicates with specific conditions, below I show the example of what I want to do,
the example table that I show below is the table without any process to result
and the example table that I show below is the table with the expected results to obtain
the conditions that I want to be processed is this table in a macro that eliminates duplicates are these
So far I have a very good macro that removes duplicates, but I haven't managed to modify it to add these conditions in the lines of code yet.
I share the macro, it is as follows:
Sub RepetidosVH()
'Declaración del diccionario
Dim dic As Scripting.Dictionary
Set dic = New Scripting.Dictionary
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Range("C3").Select
Do While Not IsEmpty(ActiveCell)
If dic.Exists(ActiveCell.Text) Then
ActiveCell.EntireRow.Delete
Else
'En esta instrucción lo que interesa es almacenar el valor de la celda como key,
'el dato equivalente al value no tiene importancia
dic.Add ActiveCell.Text, "1"
ActiveCell.Offset(1, 0).Select
End If
Loop
'limpia los recursos utilizados
dic.RemoveAll
Set dic = Nothing
Range("C3").Select
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
I share the Excel file where the example I show above is. https://drive.google.com/file/d/1KJkYZmBJP8zxgVrcS0NfxxnmZxV1xTr3/view?usp=sharing
Try this,
'C)COLOR D)INTERNAL_DE E)CLASS_DEMA F)COUNT_AREA G)SUM_AREA H)SUM_LENGTH