Hallo zusammen,
ich habe mehrere Textboxen die prüfen sollen ob was in der Zelle geschrieben steht wenn ja dann spring zur nächsten Zeile ansonsten bleib leer.
Wenn ich das ausführe schreibt und schreibe auf die 1 Textbox einen Wert hier beispielsweise Textbox6 dann wird einfach durchgehend der selbe Wert eingetragen. Obwohl die anderen Textboxen leer sind ohne Inhalt/Text.
Private Sub CommandButton1_Click()
Dim ze As Integer
With Worksheets("Indoor")
For ze = 17 To 27 Step 3
If .Cells(ze, 6) = "" Then
.Cells(ze, 6) = TextBox6.Value
If .Cells(ze + 1, 5) = "" Then
.Cells(ze + 1, 5) = TextBox7.Value
If .Cells(ze, 6) = "" Then
.Cells(ze, 6) = TextBox9.Value
If .Cells(ze + 1, 5) = "" Then
.Cells(ze + 1, 5) = TextBox10.Value
If .Cells(ze, 6) = "" Then
.Cells(ze, 6) = TextBox12.Value
If .Cells(ze + 1, 5) = "" Then
.Cells(ze + 1, 5) = TextBox13.Value
Exit For
End If
End If
End If
End If
End If
End If
Next ze
End With
Unload Me
End Sub
Vielen Dank schonmal im voraus für eure Hilfe.
Gruß
Claudia
|