AW: Textboxen in Userform füllen
23.04.2014 18:51:34
Christian
Hallo Hajo,
hier der gesamte Code:
Private Sub ListBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim i As Integer, n As Integer
Dim tmp As Integer, tmp2 As Integer
tmp = 0
For i = 1 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(i) = True Then
tmp = tmp + 1
End If
If tmp >= 15 Then
MsgBox "Nur 14 Möglichkeiten erlaubt"
tmp2 = 14
For n = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(n) = True And tmp2 >= 1 Then
tmp2 = tmp2 - 1
Else
Me.ListBox1.Selected(n) = False
End If
Next n
Exit Sub
End If
Next i
End Sub
Private Sub ListBox1_Change()
If ListBox1.Tag "" Then Exit Sub
TextBox1 = ListBox1.List(ListBox1.ListIndex, 0)
TextBox2 = ListBox1.List(ListBox1.ListIndex, 1)
TextBox3 = ListBox1.List(ListBox1.ListIndex, 2)
TextBox4 = ListBox1.List(ListBox1.ListIndex, 3)
TextBox5 = ListBox1.List(ListBox1.ListIndex, 4)
TextBox6 = ListBox1.List(ListBox1.ListIndex, 5)
TextBox7 = ListBox1.List(ListBox1.ListIndex, 6)
TextBox8 = ListBox1.List(ListBox1.ListIndex, 7)
TextBox9 = ListBox1.List(ListBox1.ListIndex, 8)
TextBox10 = ListBox1.List(ListBox1.ListIndex, 9)
TextBox11 = ListBox1.List(ListBox1.ListIndex, 10)
TextBox12 = ListBox1.List(ListBox1.ListIndex, 11)
TextBox13 = ListBox1.List(ListBox1.ListIndex, 12)
TextBox14 = ListBox1.List(ListBox1.ListIndex, 13)
End Sub
Was muss man wie ändern?
MfG Christian