Excel und VBA - Die Excel-FAQArtikel im Lagerbestand austragen |
|
Produkte
Service
Sonstiges
|
Artikel im Lagerbestand austragenProblem: Die Werte aus Blatt Ausgang sollen im Blatt Lagerbestand ausgetragen werden. StandardModule: Modul1 Sub Loeschen() Dim wks As Worksheet Dim vRow As Variant, vCol As Variant Dim iRow As Integer Set wks = Worksheets("Lagerbestand") iRow = 2 Do Until IsEmpty(Cells(iRow, 1)) vRow = Application.Match(Cells(iRow, 1).Value, wks.Columns(1), 0) If Not IsError(vRow) Then vCol = Application.Match( _ Cells(iRow, 2).Value, _ wks.Range(wks.Cells(vRow, 2), _ wks.Cells(vRow, 256)), 0) If Not IsError(vCol) Then wks.Cells(vRow, vCol + 1).Delete shift:=xlShiftToLeft End If End If iRow = iRow + 1 Loop End Sub |
||||||||||||||