AW: Inhalt Kombinationsfeld in Tabelle übernehmen
22.12.2013 20:08:23
Park
Hallo,
ich habe nun versucht, das ganze anzupassen, leider ohne Erfolg.
Ich stelle hier einmal den gesamten Code ein, der aber so nicht funktioniert.
Vielleicht kannst Du oder jemand der Experten einmal schauen, woran das liegen kann.
Vielen Dank.
Private Sub Datum_Change()
Range("C26") = TextBox1.Value
End Sub
Private Sub Liter_Change()
End Sub
Private Sub KM_Stand_Change()
End Sub
Private Sub Betrag_Change()
End Sub
Private Sub ComboBox1_Change()
Dim lRow As Long
On Error Resume Next 'Falls Bereich leer ist
lRow = Sheets("Tanken 13").Range("G28:G100").Find(What:="*", searchdirection:=xlPrevious).Row ' _
Tabellennamen anpassen
lRow = IIf(lRow = 0, 22, lRow)
Cells(lRow + 1, 7).Value = ComboBox1.Value
Unload Me
End Sub
Private Sub UserForm_Initialize()
With ComboBox1
.AddItem "Wahl 1"
.AddItem "Wahl 2"
End With
End Sub
Private Sub CommandButton1_Click()
Dim Loletzte As Long
Loletzte = IIf(IsEmpty(Cells(Rows.Count, 3)), Cells(Rows.Count, 3).End(xlUp).Row, Rows. _
Count) + 1
If TextBox1 "" And IsDate(TextBox1) Then
Cells(Loletzte, 3) = CDate(TextBox1)
If TextBox2 "" And IsNumeric(TextBox2) Then
Cells(Loletzte, 4) = CDbl(TextBox2)
End If
If TextBox3 "" And IsNumeric(TextBox3) Then
Cells(Loletzte, 6) = CDbl(TextBox3)
End If
If TextBox3 "" And IsNumeric(TextBox4) Then
Cells(Loletzte, 5) = CDbl(TextBox4)
End If
End If
Unload Me
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub