AW: Warum kommt hier denn eine Fehlermeldung ?
29.01.2009 08:24:52
Roland
Hi Tino,
was mach ich denn hier schon wieder falsch, bekomme die Gleiche Fehlermeldung wieder, wenn ich aus zwei Listen auslesen will:
(Nur eine Liste alleine funktioniert)
Roland
Option Explicit
Private Sub ComboBox9_Change()
If ComboBox9.ListIndex = -1 Then
TextBox11.Value = ""
Else
TextBox11.Value = ComboBox9.List(ComboBox9.ListIndex, 1)
End If
End Sub
Private Sub ComboBox13_Change()
If ComboBox13.ListIndex = -1 Then
TextBox14.Value = ""
TextBox15.Value = ""
Else
TextBox14.Value = ComboBox13.List(ComboBox13.ListIndex, 1)
TextBox15.Value = ComboBox13.List(ComboBox13.ListIndex, 2)
End If
End Sub
Private Sub UserForm_Initialize()
Dim WkSh As Worksheet
Dim WkSh2 As Worksheet
Dim lZeile As Long
Dim lCoBox As Long
Set WkSh = ThisWorkbook.Worksheets("Tabelle1")
With ComboBox13
.ColumnCount = 3
.ColumnWidths = ("3,0cm;0,0cm;0,0cm")
For lZeile = 3 To WkSh.Cells(WkSh.Rows.Count, 1).End(xlUp).Row
If WkSh.Range("A" & lZeile) "" Then
ComboBox13.AddItem " "
ComboBox13.List(lCoBox, 0) = WkSh.Range("A" & lZeile).Value
ComboBox13.List(lCoBox, 1) = WkSh.Range("B" & lZeile).Value
ComboBox13.List(lCoBox, 2) = WkSh.Range("C" & lZeile).Value
lCoBox = lCoBox + 1
End If
Next lZeile
End With
Set WkSh2 = ThisWorkbook.Worksheets("Tabelle2")
With ComboBox9
.ColumnCount = 3
.ColumnWidths = ("3,0cm;0,0cm;0,0cm")
For lZeile = 3 To WkSh2.Cells(WkSh2.Rows.Count, 1).End(xlUp).Row
If WkSh2.Range("A" & lZeile) "" Then
ComboBox9.AddItem " "
ComboBox9.List(lCoBox, 0) = WkSh2.Range("A" & lZeile).Value
ComboBox9.List(lCoBox, 1) = WkSh2.Range("B" & lZeile).Value
lCoBox = lCoBox + 1
End If
Next lZeile
End With
End Sub