1.6k Aufrufe
Gefragt in Tabellenkalkulation von
Hallo Leute ich brauche eure Hilfe komme nicht mehr weiter.
Bedanke mich schon mal ohne euch wäre ich verloren
Die Formel unten passt ich möchte nur das es die eingaben auf eine anderen Tabelle (z.b.Tabelle2 ) speichert und nicht auf der aktuellen Tabelle 1 !


Option Explicit

Private Sub ComboBox1_Click()
If ComboBox1.ListIndex <> 0 Then
TextBox1 = Cells(ComboBox1.ListIndex + 1, 1)
TextBox2 = Cells(ComboBox1.ListIndex + 1, 2)
TextBox3 = Cells(ComboBox1.ListIndex + 1, 3)
TextBox4 = Cells(ComboBox1.ListIndex + 1, 4)
TextBox5 = Cells(ComboBox1.ListIndex + 1, 5)
TextBox6 = Cells(ComboBox1.ListIndex + 1, 6)
TextBox7 = Cells(ComboBox1.ListIndex + 1, 7)
TextBox8 = Cells(ComboBox1.ListIndex + 1, 8)
TextBox9 = Cells(ComboBox1.ListIndex + 1, 9)
TextBox10 = Cells(ComboBox1.ListIndex + 1, 10)
TextBox11 = Cells(ComboBox1.ListIndex + 1, 11)
TextBox12 = Cells(ComboBox1.ListIndex + 1, 12)
TextBox13 = Cells(ComboBox1.ListIndex + 1, 13)
Else
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
TextBox6 = ""
TextBox7 = ""
TextBox8 = ""
TextBox9 = ""
TextBox10 = ""
TextBox11 = ""
TextBox12 = ""
TextBox13 = ""


End If
End Sub

Private Sub CommandButton1_Click()
If ComboBox1.ListIndex > 0 Then
Rows(ComboBox1.ListIndex + 1).Delete
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
TextBox6 = ""
TextBox7 = ""
TextBox8 = ""
TextBox9 = ""
TextBox10 = ""
TextBox11 = ""
TextBox12 = ""
TextBox13 = ""

UserForm_Initialize
End If
End Sub

Private Sub CommandButton2_Click()
Dim xZeile As Long
If TextBox1 = "" Then Exit Sub
If ComboBox1.ListIndex = 0 Then
xZeile = [A65536].End(xlUp).Row + 1
Else
xZeile = ComboBox1.ListIndex + 1
End If
Cells(xZeile, 1) = TextBox1
Cells(xZeile, 2) = TextBox2
Cells(xZeile, 3) = TextBox3
Cells(xZeile, 4) = TextBox4
Cells(xZeile, 5) = TextBox5
Cells(xZeile, 6) = TextBox6
Cells(xZeile, 7) = TextBox7
Cells(xZeile, 8) = TextBox8
Cells(xZeile, 9) = TextBox9
Cells(xZeile, 10) = TextBox10
Cells(xZeile, 11) = TextBox11
Cells(xZeile, 12) = TextBox12
Cells(xZeile, 13) = TextBox13

TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
TextBox6 = ""
TextBox7 = ""
TextBox8 = ""
TextBox9 = ""
TextBox10 = ""
TextBox11 = ""
TextBox12 = ""
TextBox13 = ""

End Sub

Private Sub CommandButton3_Click()
Unload Me
End Sub


Private Sub CommandButton4_Click()
Übersicht.Hide
End Sub



Private Sub UserForm_Initialize()
Dim aRow, i As Long
Application.EnableEvents = False
ComboBox1.Clear
aRow = [A65536].End(xlUp).Row
ComboBox1.AddItem "Bitte keine neue Person hinzufügen"
For i = 2 To aRow
ComboBox1.AddItem Cells(i, 1)
Next i
ComboBox1.ListIndex = 0
Application.EnableEvents = True
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
'Fehlermeldung, wenn versucht wird, die UserForm über das rote
'Schließenkreuz oben rechts zu schließen
If CloseMode = 0 Then
Cancel = 1
MsgBox "Zu blöde, um auf Schliessen zu drücken ?", _
vbOKOnly + vbInformation, "Bitte Schaltfläche betätigen."
End If

End Sub

1 Antwort

0 Punkte
Beantwortet von kauz Mitglied (291 Punkte)
Hallo,
setze einfach vor den Zellen den Namen der Tabelle wie folgt:

Sheets("Tabelle2").Cells(xZeile, 13) = TextBox13

Gruß
Kauz
...