Ungültiges Argument
Fatih
ich hoffe ich bin nicht lästig :-(
ich kann diesen code nicht mehr aufrufen, es kommt immer die meldung
eigenschaft list konnte nicht abgerufen werden. Ungültiges Argument.
Kann mir jemand vielleicht ganz kurz helfen.
Danke im vorhinein
Option Explicit
Public ListInd As Long, bol As Boolean
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub CommandButton2_Click()
Dim i As Long
ListInd = ListBox1.ListIndex
bol = True
With Sheets("Daten")
.Cells(ListBox1.ListIndex + 2, 1) = TextBox1
.Cells(ListBox1.ListIndex + 2, 2) = TextBox4
.Cells(ListBox1.ListIndex + 2, 3) = TextBox2
.Cells(ListBox1.ListIndex + 2, 4) = TextBox3
.Cells(ListBox1.ListIndex + 2, 5) = TextBox5
.Cells(ListBox1.ListIndex + 2, 6) = TextBox6
.Cells(ListBox1.ListIndex + 2, 7) = TextBox7
.Cells(ListBox1.ListIndex + 2, 8) = TextBox8
.Cells(ListBox1.ListIndex + 2, 9) = TextBox9
.Cells(ListBox1.ListIndex + 2, 10) = TextBox10
End With
For i = 1 To 10
Me.Controls("TextBox" & i) = ""
Next i
ListBox1.Clear
Call t
ListBox1.ListIndex = ListInd
With ListBox1
TextBox1 = .List(.ListIndex, 1)
TextBox2 = .List(.ListIndex, 3)
TextBox3 = .List(.ListIndex, 4)
TextBox4 = .List(.ListIndex, 2)
TextBox5 = .List(.ListIndex, 5)
TextBox6 = .List(.ListIndex, 6)
TextBox7 = .List(.ListIndex, 7)
TextBox8 = .List(.ListIndex, 8)
TextBox9 = .List(.ListIndex, 9)
TextBox10 = .List(.ListIndex, 10)
End With
MsgBox "Daten wurden korrigiert!"
End Sub
Private Sub CommandButton4_Click()
Dim i As Long
If ListBox1.ListIndex = 0 Then Exit Sub
ListBox1.ListIndex = ListBox1.ListIndex - 1
End Sub
Private Sub CommandButton3_Click()
Dim i As Long
If ListBox1.ListIndex = ListBox1.ListCount - 1 Then Exit Sub
ListBox1.ListIndex = ListBox1.ListIndex + 1
End Sub
Private Sub ListBox1_Change()
Dim i As Long
If bol Then bol = False: Exit Sub
For i = 1 To 10
Me.Controls("TextBox" & i) = ""
Next i
With ListBox1
TextBox1 = .List(.ListIndex, 1)
TextBox2 = .List(.ListIndex, 3)
TextBox3 = .List(.ListIndex, 4)
TextBox4 = .List(.ListIndex, 2)
TextBox5 = .List(.ListIndex, 5)
TextBox6 = .List(.ListIndex, 4)
TextBox7 = .List(.ListIndex, 7)
TextBox8 = .List(.ListIndex, 8)
TextBox9 = .List(.ListIndex, 9)
TextBox10 = .List(.ListIndex, 10)
End With
End Sub
Private Sub UserForm_Initialize()
Dim i As Long, DatArr As Variant
With Sheets("Daten")
If .Cells(Rows.Count, 1).End(xlUp).Row > 1 Then
DatArr = .Range("A2:J" & .Cells(Rows.Count, 1).End(xlUp).Row)
ListBox1.List = DatArr
ListBox1.ListIndex = 0
End If
End With
With ListBox1
TextBox1 = .List(.ListIndex, 1)
TextBox2 = .List(.ListIndex, 3)
TextBox3 = .List(.ListIndex, 4)
TextBox4 = .List(.ListIndex, 2)
TextBox5 = .List(.ListIndex, 5)
TextBox6 = .List(.ListIndex, 6)
TextBox7 = .List(.ListIndex, 7)
TextBox8 = .List(.ListIndex, 8)
TextBox9 = .List(.ListIndex, 9)
TextBox10 = .List(.ListIndex, 10)
End With
End Sub
Sub t()Dim DatArr As Variant
With Sheets("Daten")
If .Cells(Rows.Count, 1).End(xlUp).Row > 1 Then
DatArr = .Range("A2:J" & .Cells(Rows.Count, 1).End(xlUp).Row)
ListBox1.List = DatArr
ListBox1.ListIndex = 0
End If
End With
End Sub