Ich komme mit folgenden Code nicht weiter.
Der Code sollte nach jeder MsgBox gestoppt werden, bis alle Bedinungen erfüllt wurden.
Ich habe 3 MsgBox.
Könnte mir dazu bitte jemand weiterhelfen.
Danke Heinz
Private Sub CommandButton6_Click()
Application.ScreenUpdating = False
'Werte Eintragen in Maschinen-Blatt
Dim wksMaschine As Worksheet, bolDrucken As Boolean
Set wksMaschine = Worksheets("W311")
Application.ScreenUpdating = False
If Me.ComboBox1.ListIndex = -1 Or Me.CheckBox11 Then
MsgBox "Bitte Datum und Linie wählen!"
End If
If Me.ComboBox1.ListIndex = -1 Then
MsgBox "Bitte Datum wählen!"
End If
If Me.CheckBox11.Value = False Then
MsgBox "Bitte Linie wählen!"
Else
End If
Worksheets("W311").Unprotect Password:="test"
Worksheets("W311").Visible = True
With wksMaschine
.Range("E6") = Me.ComboBox1.Value 'Datum
.Range("E4") = Me.TextBox2 'Artikelbeschreibung
.Range("A4") = Me.TextBox3 'ArtikelNummer
.PrintOut
Worksheets("W311").Protect Password:="test"
Worksheets("W311").Visible = xlVeryHidden
End With
bolDrucken = False
Exit Sub
End Sub