AW: Eingabe in Textbox
02.08.2009 14:55:56
Stefanglander
Hallo Hary,
ich glaube ich bin mehr als ein DAU
ich habe das nun so geändert:
Private Sub CommandButton1_Click()
Dim LRow As Long
If TextBox1 = "" Then TextBox1.SetFocus
If ComboBox1 "" Then
'Textbox angeben wo die Tabelle drin steht
With Workbooks("63568.xls").Sheets(CStr(ComboBox1)) 'Blattname hier falsch
If TextBox1 = "" Then
TextBox1.SetFocus
Exit Sub
End If
'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
.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) = (Label117 = Date) '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
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, 3) = (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, 2) = (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
nun bekomme ich die Fehlermeldung Fehler beim Kompilieren, End if ohne If-Block.
Und wo ich das mit dem Label einbauen soll....
Gruß
Stefan