1004 anwendungs- oder objektdefinierter
02.03.2020 15:06:52
Eric
bei folgendem Code bekomme ich das Problem, dass (wenn ich eine if-Funktion einfügen möchte) aufgrund der Definition von " lCONST_STARTZEILENNUMMER_DER_TABELLE" den Fehler "1004 anwendungs- oder objektdefinierter fehler".
Kann mir da jemand behilflich sein?
LG Eric
Private Sub LISTE_LADEN_UND_INITIALISIEREN()
Dim lCONST_STARTZEILENNUMMER_DER_TABELLE As Long
Dim lzeile As Long
Dim lZeileMaximum As Long
Dim i As Integer
Dim lspalte As Integer
'Alle TextBoxen leer machen
For i = 1 To iCONST_ANZAHL_EINGABEFELDER
Me.Controls("TextBox" & i) = ""
Next i
ListBox1.Clear
ListBox1.ColumnCount = 4
If ComboBox2 = "2019" Then
lCONST_STARTZEILENNUMMER_DER_TABELLE = 37
End If
ListBox1.ColumnWidths = "0;40;40;40"
If ComboBox2 = "2019" Then
lZeileMaximum = 75 'Benutzer Bereich auslesen
ElseIf ComboBox2 = "2020" Then
lZeileMaximum = 150
End If
For lzeile = lCONST_STARTZEILENNUMMER_DER_TABELLE To lZeileMaximum
Tabelle2.Select
For lspalte = 3 To 500
If InStr(Cells(3, lspalte), ComboBox1.Text) 0 Then
Exit For
End If
lspalte = lspalte + 9
Next lspalte
If IST_ZEILE_LEER(lzeile) = False Then
ListBox1.AddItem lzeile
ListBox1.List(ListBox1.ListCount - 1, 1) = CStr(Tabelle2.Cells(lzeile, lspalte - 1) _
_
.Text)
ListBox1.List(ListBox1.ListCount - 1, 2) = CStr(Tabelle2.Cells(lzeile, lspalte). _
Text)
ListBox1.List(ListBox1.ListCount - 1, 3) = CStr(Tabelle2.Cells(lzeile, lspalte + 1) _
_
.Text)
ListBox1.List(ListBox1.ListCount - 1, 4) = CStr(Tabelle2.Cells(lzeile, lspalte + 2) _
_
.Text)
End If
Next lzeile
End Sub