ich habe ein Makro mit dem ich Daten aus einer Userform in ein Tabellenblatt übernehme. Makro sieht wie folgt aus
Private Sub CommandButton4_Click()
'Daten ins Formular übernehmen
If ComboBox15 = "A" Then Worksheets("A").Activate 'Datenübernahme
If ComboBox15 = "LB" Then Worksheets("A").Activate
If _
UserForm3.ComboBox4.Value = "" Or _
UserForm3.ComboBox5.Value = "" Or _
UserForm3.ComboBox7.Value = "" Or _
UserForm3.ComboBox8.Value = "" Or _
UserForm3.ComboBox9.Value = "" Or _
UserForm3.ComboBox24.Value = "" Or _
UserForm3.ComboBox15.Value = "" Then MsgBox ("Bitte Eingaben überprüfen!"):
Exit Sub
If UserForm3.ComboBox11.Value = "" And UserForm3.ComboBox3.Value = "" And UserForm3.TextBox7. _
Value = "" And UserForm3.TextBox10.Value = "" Then _
MsgBox ("Bitte Eingaben überprüfen!"):
Exit Sub
'Prüfen ob Mutipage2 = Fehlerart gefüllt ist
If UserForm3.ComboBox13.Value = "" And UserForm3.TextBox9.Value = "" And UserForm3.TextBox11. _
Value = "" Then _
MsgBox ("Bitte Eingaben überprüfen!"):
Exit Sub
'Prüfen ob Maßnahmen eingetragen sind
If UserForm3.ComboBox17.Value = "" And UserForm3.ComboBox18.Value = "" And UserForm3.ComboBox19. _
Value = "" And UserForm3.ComboBox20.Value = "" And UserForm3.ComboBox21.Value = "" And UserForm3.ComboBox22.Value = "" And UserForm3.ComboBox23.Value = "" And UserForm3.ComboBox25.Value = "" And UserForm3.TextBox31.Value = "" Then _
MsgBox ("Bitte Eingaben überprüfen!"):
Exit Sub
'Prüfen ob ein Verursacher eingetragen sind
If UserForm3.ComboBox33.Value = "" And UserForm3.ComboBox16.Value = "" Then _
MsgBox ("Bitte Eingaben überprüfen!"):
Exit Sub
'Ersteller
Cells(5, 15) = Me.ComboBox4
'Datum
Cells(7, 15) = Me.TextBox39
'Typ
Cells(10, 15) = Me.ComboBox10
'Übernahme in Datenbank
Worksheets("Daten").Activate
Dim StartZeile&
Dim Ws As Worksheet
Set Ws = ActiveSheet
StartZeile = Ws.Cells(65536, 1).End(xlUp).Row + 1
'Datum
Ws.Cells(StartZeile, 1) = Me.TextBox39
Ws.Cells(StartZeile, 2) = Me.ComboBox4
'Typ
Ws.Cells(StartZeile, 3) = Me.ComboBox5
'Fedler leeren
Dim i As Long
Dim iIndex As Integer
For iIndex = 1 To 33
With Controls("ComboBox" & iIndex)
.Value = ""
End With
Next iIndex
For iIndex = 1 To 38
With Controls("TextBox" & iIndex)
.Value = ""
End With
Next iIndex
For iIndex = 1 To 6
With Controls("CheckBox" & iIndex)
.Value = False
End With
Next iIndex
'Übernahme für Ampel AB HIER GEHT NIX MEHR WENN ICH NOCH DATEN IN EIN ANDERES SHEET ÜBERNEHMEN _
MÖCHTE!
Worksheets("Ampel").Activate
'Dim StartZeile&
'Dim Ws As Worksheet
Set Ws = ActiveSheet
StartZeile = Ws.Cells(65536, 1).End(xlUp).Row + 1
'Bauteil
Ws.Cells(StartZeile, 1) = Me.ComboBox11 & Me.ComboBox3 & Me.TextBox7 & Me.TextBox10
'Datum
Ws.Cells(StartZeile, 2) = Me.TextBox39
MultiPage1("Page1").Visible = True
MultiPage1("Page2").Visible = True
MultiPage1("Page3").Visible = True
MultiPage1("Page4").Visible = True
MultiPage2("Page1").Visible = True
MultiPage2("Page2").Visible = True
MultiPage2("Page3").Visible = True
Worksheets("A").Activate
UserForm3_Terminate
ActiveWorkbook.Save
End Sub
Was kann ich ändern damit auch eine Datenübernahme ins Tabellenblatt Ampel möglich wird?Kann mir bitte jemand helfen?
MfG René