Ich habe Multiseiten, auf denen eine ComboBox ist, die mit Werten aus unterschiedlichen Tabellenblättern gefüllt wird.
ComboBox1 (auf Page1) zieht Werte aus Tabelle1, Textbox 1-5
ComboBox2 (auf Page2) zieht Werte aus Tabelle2, TextBox 5-10
ComboBox3 (auf Page3) zieht Werte aus Tabelle3, TextBox 11-15
ComboBox4 (auf Page4) zieht Werte aus Tabelle4, TextBox 16-20
Ich habe bereits ein Speicherbutton, welcher aber nur die geänderten Werte auf Tabelle1 ändert. Wie kann ich den Code umschreiben für Tabelle2, Tabelle3 und Tabelle4?
Private Sub Speichern_Click()
If CheckBox1 = True Then
Cells(ComboBox1.ListIndex + 1, 5) = TextBox1
Cells(ComboBox1.ListIndex + 1, 10) = TextBox2
Cells(ComboBox1.ListIndex + 1, 3) = TextBox3
Cells(ComboBox1.ListIndex + 1, 12) = TextBox4
Cells(ComboBox1.ListIndex + 1, 13) = TextBox5
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
UserForm_Activate
CheckBox1 = False
ThisWorkbook.Save
Else
MsgBox ("Bitte bestätigen Sie die Änderung mit dem Kontrollkästchen!")
End If
End Sub