Wenn ich meine Daten so einsetze und übertrage wie im folgendem Code angewendet ist alles toll, bis auf die Tatsache daß meine Formeln, die z.B. in Spalte D oder Array in Spalte F , nicht mit übernohmen werden.
Frage was mach ich Falsch,bzw wie ist es besser?
Private Sub CommandButton1_Click()
TextBox1 = ListBox1.List(ListBox1.ListIndex, 0)
TextBox2 = ListBox1.List(ListBox1.ListIndex, 1)
TextBox3 = ListBox1.List(ListBox1.ListIndex, 2)
TextBox4 = ListBox1.List(ListBox1.ListIndex, 3)
TextBox5 = ListBox1.List(ListBox1.ListIndex, 4)
TextBox6 = ListBox1.List(ListBox1.ListIndex, 5)
Sheets(1).Cells(Sheets(1).Cells(Rows.Count, 6).End(xlUp).Row - 4, 1) = TextBox1.Text
Sheets(1).Cells(Sheets(1).Cells(Rows.Count, 6).End(xlUp).Row - 4, 2) = TextBox2.Text
Sheets(1).Cells(Sheets(1).Cells(Rows.Count, 6).End(xlUp).Row - 4, 3) = TextBox3.Text
Sheets(1).Cells(Sheets(1).Cells(Rows.Count, 6).End(xlUp).Row - 4, 4) = TextBox4.Text
Sheets(1).Cells(Sheets(1).Cells(Rows.Count, 6).End(xlUp).Row - 4, 5) = TextBox5.Text
Sheets(1).Cells(Sheets(1).Cells(Rows.Count, 6).End(xlUp).Row - 4, 6) = TextBox6.Text
Sheets(1).Rows(Sheets(1).Cells(Sheets(1).Rows.Count, 1).End(xlUp).Row - 3).Insert
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
CommandButton1.Caption = "Zeile einfügen"
CommandButton2.Caption = "Abbrechen"
ListBox1.ColumnCount = 6
ListBox1.ColumnWidths = "2cm;6cm;2cm;1,5cm;2cm;2,5cm"
UserForm1.ListBox1.List = Worksheets("Datenbank").Range("A5:F119").CurrentRegion.Value
End Sub
Für Vorschläge wäre ich Dankbar
TJ