könnte bitte noch jemand sich meiner annehmen?
https://www.herber.de/forum/messages/499250.html
Sub Kumulieren()
Dim n2&, n1&, n3&
n1 = 2: n2 = 2: n3 = 2
Do
If Cells(n1, 1) = Cells(n2, 3) Then
Cells(n3, 8) = Cells(n1, 1)
Cells(n3, 9) = Cells(n2, 4) - Cells(n1, 2)
n1 = n1 + 1: n2 = n2 + 1
ElseIf Cells(n1, 1) > Cells(n2, 3) Or Cells(n1, 1) = Empty Then
Cells(n3, 8) = Cells(n2, 3)
Cells(n3, 9) = Cells(n2, 4)
n2 = n2 + 1
ElseIf Cells(n1, 1) < Cells(n2, 3) Or Cells(n2, 3) = Empty Then
Cells(n3, 8) = Cells(n1, 1)
Cells(n3, 9) = -Cells(n1, 2)
n1 = n1 + 1
End If
n3 = n3 + 1
If Cells(n1, 1) = Empty And Cells(n2, 3) = Empty Then Exit Do
Loop
End Sub
Die erweiterte Suchfunktion hilft dir, gezielt die besten Antworten zu finden
Suche nach den besten AntwortenEntdecke unsere meistgeklickten Beiträge in der Google Suche
Top 100 Threads jetzt ansehen