Ich habe folgende UF:
Private Sub CommandButton1_Click()
Dim LRow As Long
If ComboBox1 "" Then
'Textbox angeben wo die Tabelle drin steht
With Workbooks("Recherche_Ergebnisse.xls").Sheets(CStr(ComboBox1))
LRow = .Cells(.Rows.Count, 1).End(xlUp).Row 'letzte Zeile?
LRow = LRow + 1 'nächste leere Zeile
.Unprotect "walker"
'MsgBox "Blattschutz ist aufgehoben!"
.Cells(LRow, 1) = (TextBox11) 'Lfd.Nr.
.Cells(LRow, 3) = (TextBox1) 'Arbeitgeber
.Cells(LRow, 5) = (TextBox2) 'PLZ
.Cells(LRow, 6) = (TextBox3) 'Ort
.Cells(LRow, 4) = (TextBox4) 'Straße
.Cells(LRow, 2) = (TextBox5) 'Erstellungsdatum
.Cells(LRow, 7) = (TextBox6) 'Telefon
.Cells(LRow, 8) = (TextBox7) 'Ansprechpartner
.Cells(LRow, 9) = (TextBox8) 'Stellenbeschreibung
.Cells(LRow, 11) = (ComboBox2) 'Stellenherkunft
.Cells(LRow, 10) = (TextBox9) 'Ausgabedatum
.Cells(LRow, 12) = (TextBox10) 'Bemerkungen
.Protect "walker"
'MsgBox "Blattschutz ist gesetzt!"
End With
With Workbooks("Recherche_Ergebnisse.xls").Sheets("Alle")
LRow = .Cells(.Rows.Count, 1).End(xlUp).Row 'letzte Zeile?
LRow = LRow + 1 'nächste leere Zeile
.Cells(LRow, 1) = (TextBox11) 'Lfd.Nr.
.Cells(LRow, 4) = (TextBox1) 'Arbeitgeber
.Cells(LRow, 6) = (TextBox2) 'PLZ
.Cells(LRow, 7) = (TextBox3) 'Ort
.Cells(LRow, 5) = (TextBox4) 'Straße
.Cells(LRow, 2) = (TextBox5) 'Erstellungsdatum
.Cells(LRow, 8) = (TextBox6) 'Telefon
.Cells(LRow, 9) = (TextBox7) 'Ansprechpartner
.Cells(LRow, 10) = (TextBox8) 'Stellenbeschreibung
.Cells(LRow, 12) = (ComboBox2) 'Stellenherkunft
.Cells(LRow, 11) = (TextBox9) 'Ausgabedatum
.Cells(LRow, 13) = (TextBox10) 'Bemerkungen
.Cells(LRow, 3) = (TextBox13) 'Zeit
With Workbooks("Recherche_Ergebnisse.xls").Sheets("Variablen")
.Range("M2") = (TextBox11) 'Lfd.Nr
End With
'Textboxen leeren
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
TextBox6 = ""
TextBox7 = ""
TextBox8 = ""
TextBox9 = ""
TextBox10 = ""
TextBox13 = ""
ComboBox2.ListIndex = -1
ComboBox1.ListIndex = -1
End With
End If
Unload UserForm1
End Sub
wie kann ich eine Fehlermeldung in Form einer MSG-Box anzeigen lassen, wenn der Anwender die Textboxen 1-8 nicht ausgefüllt hat?Mag mir jemand helfen ?
Gruss
Stefan