ich habe eine Excel Tabelle, die ich über eine UserForm1 befüllen lasse. jetzt möchte ich, dass wenn in meiner ComboBox1 ein bestimmter text steht oder eben etwas Bestimmtes ausgewählt ist, das in einer Zelle ein bestimmter Wert eingetragen wird (das sollen die zwei IF's darstellen), es kommt kein fehler, aber es erscheint auch nichts in meiner Tabelle. Was habe ich falsch gemacht? Oder ist das allgemein der flasche weg dafür
Private Sub CommandButton1_Click()
Cells(Cells(Rows.Count, "A").End(xlUp).Row + 1, "A").Value = TextBox1.Text 'Datum
Cells(Cells(Rows.Count, "B").End(xlUp).Row + 1, "B").Value = TextBox2.Text 'Zeit
Cells(Cells(Rows.Count, "C").End(xlUp).Row + 1, "C").Value = CDbl(TextBox3.Text) 'Temperatur
Cells(Cells(Rows.Count, "D").End(xlUp).Row + 1, "D").Value = TextBox4.Text 'Prüfer
Cells(Cells(Rows.Count, "E").End(xlUp).Row + 1, "E").Value = Cells(Cells(Rows.Count, "E").End( _
xlUp).Row, "E").Value + 1 'Messung
Cells(Cells(Rows.Count, "F").End(xlUp).Row + 1, "F").Value = ComboBox1.Text 'Verfahren
Cells(Cells(Rows.Count, "G").End(xlUp).Row + 1, "G").Value = ComboBox2.Text 'Hä _
rtevergleichsplatte
If ComboBox1.Text = "Deloro 5879.1116 - HBW 2.5/62,5" Then
Cells(Cells(Rows.Count, "H").End(xlUp).Row + 1, "H").Value = "192"
End If
If ComboBox1.Text = "Deloro 5879.1116 - HBW 2.5/62,5" Then
Cells(Cells(Rows.Count, "I").End(xlUp).Row + 1, "I").Value = "1.9"
End If
Cells(Cells(Rows.Count, "J").End(xlUp).Row + 1, "J").Value = CDbl(TextBox5.Text) ' _
Referenzeindruck messen
Cells(Cells(Rows.Count, "P").End(xlUp).Row + 1, "P").Value = CDbl(TextBox6.Text) '1. Messung
Cells(Cells(Rows.Count, "Q").End(xlUp).Row + 1, "Q").Value = CDbl(TextBox7.Text) '2. Messung
Cells(Cells(Rows.Count, "R").End(xlUp).Row + 1, "R").Value = CDbl(TextBox8.Text) '3. Messung
Cells(Cells(Rows.Count, "S").End(xlUp).Row + 1, "S").Value = CDbl(TextBox9.Text) '4. Messung
Cells(Cells(Rows.Count, "T").End(xlUp).Row + 1, "T").Value = CDbl(TextBox10.Text) '5. Messung
Unload UserForm1
End Sub
Viele Grüße,Zoe