ich steh vor einer Herausforderung, bei der ich eure Hilfe benötige. Ich habe eine "Bestellliste", in der Artikel mehrfach vorkommen. Die daraus folgende "Kommissionierliste" soll die jeweilige Summe zum Artikel haben.
Meine bisherige Umsetzung zeigt die Summe zum Artikel, jedoch übernimmt er im Grunde die "Bestellliste" statt eine Zusammenfassung für die "Kommissionierliste" zu erstellen.
Wie könnte man das umsetzen?
Sub KommiListe()
Dim WbQ As Workbook, WbZ As Workbook, WsQ As Worksheet
Dim WsZ As Worksheet
Dim i As Long, letzte As Long, ImportListe As Long
Dim lngAnzahl As Long
ScreenUpdating = False
Set WbQ = ThisWorkbook
Set WsQ = WbQ.Worksheets("Ergebnis")
Set WbZ = Workbooks.Add(template:=xlWBATWorksheet)
Set WsZ = WbZ.Worksheets(1)
letzte = WsQ.Cells(WsQ.Rows.Count, 1).End(xlUp).Row
ImportListe = WsZ.Cells(WsZ.Rows.Count, 1).End(xlUp).Row
For i = 2 To letzte
WsZ.Cells(ImportListe + 1, 1) = WsQ.Cells(i, 6).Value
WsZ.Cells(ImportListe + 1, 2) = WsQ.Cells(i, 7).Value
WsZ.Cells(ImportListe + 1, 3) = WorksheetFunction.CountIf(Columns(7), Cells(i, 7))
WsZ.Cells(ImportListe + 1, 4) = WsQ.Cells(i, 8).Value
ImportListe = ImportListe + 1
Next i
With WsZ
.Cells(1, 1) = "Artikelnummer"
.Cells(1, 2) = "Bezeichnung"
.Cells(1, 3) = "Menge"
.Cells(1, 4) = "Lagerplatz"
End With
Set WbQ = Nothing: Set WbZ = Nothing: Set WsQ = Nothing
Set WsZ = Nothing: Set tQ = Nothing
End Sub