ich hoffe, daß mir jemand weiter helfen kann.
Ich möchte eine Listbox, die mehr als 10 Spalten hat mit Daten füllen.
Bis hierhin kein Problem (siehe Code). Es sollen aber nur die Werte an-
gezeigt werden, die in Spalte A dem Inhalt einer Textbox entsprechen.
In der Praxis : Spalte A = Kundennummer, Zeilen = Fahrzeugdaten; hierbei
können mehrere Fahrzeuge einer Kundennummer entsprechen.
Private Sub UserForm_Initialize()
Application.ScreenUpdating = False 'flackern abschalten
Dim AppExcel As Object
Dim Pfad As String
Dim Datei As String
Dim arrWerte As Variant
Pfad = "W:\Omni_KFZ\"
Datei = "PFV_Liste_kpl.xlsm"
ListBox1.ColumnCount = 30
ListBox1.ColumnWidths = "2cm;4cm;3cm;4cm;1cm;1,5cm;4cm;0cm;0cm;0cm;0cm;0cm;0cm;0cm;0cm;2cm; _
4cm;0cm;2cm;2cm"
Set AppExcel = GetObject(Pfad & Datei)
arrWerte = AppExcel.Sheets("Liste").[A2:AD1000]
ListBox1.List = arrWerte
AppExcel.Close False
Set AppExcel = Nothing
Application.ScreenUpdating = True
End Sub
Private Sub ListBox1_Change()
If ListBox1.Tag "" Then Exit Sub
T0 = ListBox1.List(ListBox1.ListIndex, 0)
T1 = ListBox1.List(ListBox1.ListIndex, 1)
T2 = ListBox1.List(ListBox1.ListIndex, 2)
T3 = ListBox1.List(ListBox1.ListIndex, 3)
T4 = ListBox1.List(ListBox1.ListIndex, 4)
T5 = ListBox1.List(ListBox1.ListIndex, 5)
T6 = ListBox1.List(ListBox1.ListIndex, 6)
T7 = ListBox1.List(ListBox1.ListIndex, 7)
T8 = ListBox1.List(ListBox1.ListIndex, 8)
T9 = ListBox1.List(ListBox1.ListIndex, 9)
T10 = ListBox1.List(ListBox1.ListIndex, 10)
T11 = ListBox1.List(ListBox1.ListIndex, 11)
T12 = ListBox1.List(ListBox1.ListIndex, 12)
T13 = ListBox1.List(ListBox1.ListIndex, 13)
T14 = ListBox1.List(ListBox1.ListIndex, 14)
T15 = ListBox1.List(ListBox1.ListIndex, 15)
T16 = ListBox1.List(ListBox1.ListIndex, 16)
T17 = ListBox1.List(ListBox1.ListIndex, 17)
T18 = ListBox1.List(ListBox1.ListIndex, 18)
T19 = ListBox1.List(ListBox1.ListIndex, 19)
T20 = ListBox1.List(ListBox1.ListIndex, 20)
T21 = ListBox1.List(ListBox1.ListIndex, 21)
T22 = ListBox1.List(ListBox1.ListIndex, 22)
T23 = ListBox1.List(ListBox1.ListIndex, 23)
T24 = ListBox1.List(ListBox1.ListIndex, 24)
T25 = ListBox1.List(ListBox1.ListIndex, 25)
T26 = ListBox1.List(ListBox1.ListIndex, 26)
T27 = ListBox1.List(ListBox1.ListIndex, 27)
T28 = ListBox1.List(ListBox1.ListIndex, 28)
T29 = ListBox1.List(ListBox1.ListIndex, 29)
End Sub