AW: Listbox immer gleiche Auswahl
11.05.2005 15:45:10
GeorgK
Hallo Hajo,
vielen Dank für Deine Info.
Ich übergebe die Daten ins Tabellenblatt mit:
Sub CommandButton1_Click()
Application.ScreenUpdating = False
Sheets("Tabelle5").Select
[a65536].End(xlUp).Offset(1, 0) = TextBox1
[a65536].End(xlUp).Offset(0, 1) = TextBox2
[a65536].End(xlUp).Offset(0, 2) = TextBox3
[a65536].End(xlUp).Offset(0, 3) = TextBox4
[a65536].End(xlUp).Offset(0, 4) = TextBox5
[a65536].End(xlUp).Offset(0, 5) = TextBox6
[a65536].End(xlUp).Offset(0, 6) = TextBox7
[a65536].End(xlUp).Offset(0, 7) = TextBox8
[a65536].End(xlUp).Offset(0, 8) = TextBox10
[a65536].End(xlUp).Offset(0, 9) = TextBox9
Call textlöschen
ListBox1.ListIndex = 0
ListBox2.ListIndex = 0
Sheets("Tabelle1").Select
End Sub
Wenn ich nach der Listbox 1, die Listbox2 anfüge, bekomm ich nur in der Listbox1 die erste Zeile. In der Listbox2 verändert sich nichts.
Die 2. Listbox füllt sich:
Private Sub ListBox1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Dim li, lz As Integer
li = ListBox1.ListIndex + 1
lz = Cells(65536, li).End(xlUp).Row
If ListBox1.ListIndex = 0 Then ListBox2.RowSource = "Tabelle2!Y2:Y3" & lz
If ListBox1.ListIndex = 1 Then ListBox2.RowSource = "Tabelle2!Y2:Y3" & lz
If ListBox1.ListIndex = 2 Then ListBox2.RowSource = "Tabelle2!V1:V2" & lz
If ListBox1.ListIndex = 3 Then ListBox2.RowSource = "Tabelle2!W1:W2" & lz
If ListBox1.ListIndex = 4 Then ListBox2.RowSource = "Tabelle2!X1:X1" & lz
End Sub
Nach der Datenübernahme sollen beide Listbox wieder die erste Zeile anzeigen.
Grüße
Georg