AW: ListBox Eintrag selektieren
19.01.2022 18:44:25
Frank
Hallo Gerd!
Der Code des Buttons!
Private Sub CommandButton9_Click()
Sheets("Titel - Daten").Activate 'Das Blatt "Ordner - Namen" aktivieren
With frmCDerfassung
Dim lngRows As Long
lngRows = frmCDerfassung.ListBox2.Column(8) 'Hier steht die Zeilennummer
If TextBox14 = "" Then
Cells(lngRows, 1) = ""
Else
Cells(lngRows, 1) = CDbl(TextBox14)
End If
If TextBox15 = "" Then
Cells(lngRows, 2) = ""
Else
Cells(lngRows, 2) = CDbl(TextBox15)
End If
Cells(lngRows, 3) = TextBox8
Cells(lngRows, 4) = TextBox9
Cells(lngRows, 5) = TextBox10
Cells(lngRows, 6) = TextBox11
If TextBox12 = "" Then
Cells(lngRows, 7) = ""
Else
If Len(TextBox12) 'Hier hatte ich immer eure Vorschläge stehen!
End Sub
Private Sub ListBox2_Click()
With frmCDerfassung
TextBox14 = .ListBox2.Column(0, .ListBox2.ListIndex)
TextBox15 = .ListBox2.Column(1, .ListBox2.ListIndex)
TextBox8 = .ListBox2.Column(2, .ListBox2.ListIndex)
TextBox9 = .ListBox2.Column(3, .ListBox2.ListIndex)
TextBox10 = .ListBox2.Column(4, .ListBox2.ListIndex)
TextBox11 = .ListBox2.Column(5, .ListBox2.ListIndex)
TextBox12 = .ListBox2.Column(6, .ListBox2.ListIndex)
TextBox13 = .ListBox2.Column(7, .ListBox2.ListIndex)
End With
Label45.Caption = ""
Label45.BackColor = &HC0C0FF
TextBox9.SetFocus
TextBox9.SelStart = 0
End Sub