Ich habe da mal eine Frage. Gibt es in Excel VBA eine "If only" Funktion, dass heißt ob man abfragen kann ob nur ein bestimmtes Objekt in einer Zeile vorhanden ist.
Private Sub Auslagerliste_erstellen_Click()
Dim i As Integer
Dim last As Integer
last = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row + 1
Worksheets("Werkzeugtabelle").Activate
If ZK_N73_AFO200.Value = False And ZK_N73_AFO300 = True And HEAT_MF170_AFO300 = True And _
HEAT_MR170_AFO300 = True And HEAT_XLR_AFO400 = True And HEAT_XLR_AFO50 = True And KGH_S85_AFO300 = True And KGH_S85_AFO600 = True Then
For i = 2 To 2000
If Not Range("K" & i & ":N" & i).Value = "HEAT MF170, AFO 300" And Range("K" & i & ":N" & i) _
.Value = "HEAT MR170, AFO 300" And Range("K" & i & ":N" & i).Value = "HEAT XLR220, AFO 400" And Range("K" & i & ":N" & i).Value = "HEAT XLR220, AFO 50" And Range("K" & i & ":N" & i).Value = "KGH S85, AFO 300" And Range("K" & i & ":N" & i).Value = "KGH S85, AFO 600" And Range("K" & i & ":N" & i).Value = "ZK N73, AFO 300" Then
Rows(i).Select
Selection.Copy
Sheets("Auslagerliste").Activate
Cells(last, 1).Insert
End If
Next
End If
End Sub
Meine Datei im Link: