- Katılım
- 6 Temmuz 2008
- Mesajlar
- 1,875
- Excel Vers. ve Dili
- OFFİCE 2010- TÜRKÇE
Merhaba
Bir kod var onda duzenleme ıstıyorum yardımcı olabılrısınz
kodda a ve b sutunlarında aynı olanları bırlestırıp adetını de topluyor duzeltme a-b-c sutunlarında olan bılgılerı yıne a ve b birleşecek c ise toplanacak sekılde yapılabılırmı
Sub BensersizListeleTopla()
Dim d, s, a1, a2, deg, i As Integer, son As Long
Set d = CreateObject("Scripting.Dictionary")
Application.ScreenUpdating = False
For i = 2 To Cells(Rows.Count, "A").End(xlUp).Row
deg = Cells(i, "A")
If Not d.exists(deg) Then
s = Array(1, Cells(i, "B"))
d.Add deg, s
Else
s = d.Item(deg)
s(1) = s(1) + Cells(i, "B")
d.Item(deg) = s
End If
Next i
a1 = d.keys: a2 = d.items
Range("A2:A" & Rows.Count).ClearContents
For i = 0 To d.Count - 1
Cells(i + 2, "A") = a1(i)
s = a2(i)
Cells(i + 2, "B") = s(1)
Next i
son = Cells(Rows.Count, "A").End(xlUp).Row + 1
Range("B" & son & ":B" & Rows.Count).ClearContents
Set d = Nothing
Application.ScreenUpdating = True
End Sub
Bir kod var onda duzenleme ıstıyorum yardımcı olabılrısınz
kodda a ve b sutunlarında aynı olanları bırlestırıp adetını de topluyor duzeltme a-b-c sutunlarında olan bılgılerı yıne a ve b birleşecek c ise toplanacak sekılde yapılabılırmı
Sub BensersizListeleTopla()
Dim d, s, a1, a2, deg, i As Integer, son As Long
Set d = CreateObject("Scripting.Dictionary")
Application.ScreenUpdating = False
For i = 2 To Cells(Rows.Count, "A").End(xlUp).Row
deg = Cells(i, "A")
If Not d.exists(deg) Then
s = Array(1, Cells(i, "B"))
d.Add deg, s
Else
s = d.Item(deg)
s(1) = s(1) + Cells(i, "B")
d.Item(deg) = s
End If
Next i
a1 = d.keys: a2 = d.items
Range("A2:A" & Rows.Count).ClearContents
For i = 0 To d.Count - 1
Cells(i + 2, "A") = a1(i)
s = a2(i)
Cells(i + 2, "B") = s(1)
Next i
son = Cells(Rows.Count, "A").End(xlUp).Row + 1
Range("B" & son & ":B" & Rows.Count).ClearContents
Set d = Nothing
Application.ScreenUpdating = True
End Sub
Son düzenleme:
