ich habe ein Range Bereich, der in einer Schleife durchlaufen wird. Bei der if Anweisung soll er prüfen, ob der Value = "1" oder "0" ist. Aber beim Ausführen, nimmt er alles und geht immer in die Sprungmarke rein. Was mache ich falsch? Kann das vlt was mit dem Datentyp zutun haben?
Gruß+Danke, Zara
Option Explicit
Dim lzstapelbarattribut As Long
Dim stapelbarattribut As Range
With Sheets("Tabelle1")
lzstapelbarattribut = .Cells(.Rows.Count, 1).End(xlUp).Row
For Each stapelbarattribut In .Range(.Cells(1, 1), .Cells(lzstapelbarattribut, 1))
If stapelbarattribut.Value = "1" Then
GoTo stapel1
If stapelbarattribut.Value = "0" Then
GoTo Stapel0
Else: MsgBox "INFO: Es ist kein Stapelbar-Attribut hinterlegt."
Exit Sub
End If
End If
Next stapelbarattribut
End With
stapel1: MsgBox "Stapel1 klappt."
Stapel0: MsgBox "Stapel2 klappt."
End Sub