hello
I have data a bout 10000 rows so what I want merge items and sum values without loop
I found this code but I no know how modify it
and this sample simple to understand my data
I have data a bout 10000 rows so what I want merge items and sum values without loop
I found this code but I no know how modify it
and this sample simple to understand my data
date | commidaty | model | q | commidaty | q | ||||||
01/01/2021 | car1 | bmw | 200 | car1 | 250 | ||||||
01/02/2021 | car1 | bmw | 50 | car2 | 30 | ||||||
01/03/2021 | car2 | mer | 10 | ||||||||
01/04/2021 | car2 | mer | 20 | ||||||||
VBA Code:
Sub dupremove()
Dim ws As Worksheet
Dim lastrow As Long
Set ws = Sheets("Sheet1") ' Change to your sheet
With ws
lastrow = .Range("b" & .Rows.Count).End(xlUp).Row
With .Range("d2:d" & lastrow)
.Offset(, 9).FormulaR1C1 = "=SUMIF(C1,RC1,C[-9])"
.Offset(, 9).Value = .Offset(, 9).Value
End With
With .Range("b2:b" & lastrow)
.Offset(, 9).Value = .Value
End With
.Range("k2: l" & lastrow).RemoveDuplicates 1, xlYes
End With
End Sub