bei meiner Eingabemaske kommt immer der Fehler Laufzeitfehler 13 Typen unverträglich.
So sieht der Code aus:
Private Sub CommandButton1_Click()
UserForm2.Hide
End Sub
Private Sub CommandButton2_Click()
If ComboBox1.ListIndex > 0 Then
Rows(ComboBox1.ListIndex + 1).Delete
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
TextBox6 = ""
TextBox7 = ""
TextBox8 = ""
TextBox9 = ""
TextBox10 = ""
UserForm_Initialize
End If
End Sub
Private Sub CommandButton3_Click()
Dim xZeile As Long
If TextBox1 = "" Then Exit Sub
If ComboBox1.ListIndex = 0 Then
xZeile = [B65536].End(xlUp).Row + 1
Else
xZeile = ComboBox1.ListIndex + 1
End If
Cells(xZeile, 2) = TextBox1
Cells(xZeile, 3) = TextBox2
Cells(xZeile, 4) = TextBox3
Cells(xZeile, 5) = TextBox4
Cells(xZeile, 6) = TextBox5
Cells(xZeile, 8) = TextBox6
Cells(xZeile, 10) = TextBox7
Cells(xZeile, 12) = TextBox8
Cells(xZeile, 13) = TextBox9
Cells(xZeile, 16) = TextBox10
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
TextBox6 = ""
TextBox7 = ""
TextBox8 = ""
TextBox9 = ""
TextBox10 = ""
Columns("B:Q").Sort Key1:=Range("B5"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
UserForm_Initialize
End Sub
Private Sub UserForm_Initialize()
Dim aRow, i As Variant
Application.EnableEvents = False
ComboBox1.Clear
aRow = [B65536].End(xlUp).Row
For i = 5 To aRow
ComboBox1.AddItem Cells(i, 1) & ", " & Cells(i, 2)
Next i
ComboBox1.ListIndex = 0
Application.EnableEvents = True
End Sub
Ich habe keine Ahnung, wo der Fehler liegen könnte.
Vielleicht hat von euch jemand eine Idee.
Gruß und Danke
Brunito