Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
1252to1256
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

Listboxeinträge per Doppelklick in Userform laden

Listboxeinträge per Doppelklick in Userform laden
Roger
Guten Tag,
Ich habe eine Listbox:
Private Sub Suche(suchbegriff_1 As String, suchbegriff_2 As String)
Dim i As Long, k As Integer
Dim n As Long
On Error Resume Next
Dim arrTMP As Variant
ReDim arrTMP(1 To UBound(arrDaten, 2), 1 To UBound(arrDaten))
For i = 1 To UBound(arrDaten)
If LCase$(arrDaten(i, 1)) Like suchbegriff_1 & "*" Then
If LCase$(arrDaten(i, 2)) Like suchbegriff_2 & "*" Then
n = n + 1
For k = 1 To UBound(arrDaten, 2)
arrTMP(k, n) = arrDaten(i, k)
Next
End If
End If
Next
If n Then
ReDim Preserve arrTMP(1 To UBound(arrDaten, 2), 1 To n)
ListBox1.Column = arrTMP
End If
End Sub
Die Daten übertrage ich in eine Sheet.
Private Sub Commandbutton2_Click()
Set Frm = UserForm3
Sheets("Hauptblatt").Activate
Cells(65536, 1).End(xlUp).Offset(1, 0).Select
With Frm
ActiveCell.Offset(0, 0).Value = .TextBox1.Value
ActiveCell.Offset(0, 1).Value = .TextBox2.Value
ActiveCell.Offset(0, 2).Value = .TextBox3.Value
ActiveCell.Offset(0, 3).Value = .TextBox4.Value
ActiveCell.Offset(0, 4).Value = .TextBox5.Value
ActiveCell.Offset(0, 5).Value = .TextBox6.Value
ActiveCell.Offset(0, 6).Value = .TextBox7.Value
ActiveCell.Offset(0, 7).Value = .TextBox8.Value
ActiveCell.Offset(0, 8).Value = .TextBox9.Value
ActiveCell.Offset(0, 9).Value = .TextBox10.Value
ActiveCell.Offset(0, 10).Value = .CheckBox1.Value
ActiveCell.Offset(0, 11).Value = .CheckBox2.Value
ActiveCell.Offset(0, 12).Value = .CheckBox3.Value
ActiveCell.Offset(0, 13).Value = .CheckBox4.Value
ActiveCell.Offset(0, 14).Value = .CheckBox5.Value
ActiveCell.Offset(0, 15).Value = .CheckBox6.Value
ActiveCell.Offset(0, 16).Value = .CheckBox7.Value
ActiveCell.Offset(0, 17).Value = .CheckBox8.Value
ActiveCell.Offset(0, 18).Value = .CheckBox9.Value
ActiveCell.Offset(0, 19).Value = .CheckBox10.Value
ActiveCell.Offset(0, 20).Value = .TextBox11.Value
ActiveCell.Offset(0, 21).Value = .TextBox12.Value
ActiveCell.Offset(0, 22).Value = .TextBox13.Value
ActiveCell.Offset(0, 23).Value = .TextBox14.Value
ActiveCell.Offset(0, 24).Value = .TextBox15.Value
ActiveCell.Offset(0, 25).Value = .TextBox16.Value
ActiveCell.Offset(0, 26).Value = .TextBox17.Value
ActiveCell.Offset(0, 27).Value = .TextBox18.Value
End With
Unload UserForm3
End Sub
Soweit so gut :-)
Jetzt möchte ich, wenn ich den Eintrag in der Listbox mit Doppelklick auswähle, dass die Userform mit den ausgwählten Daten geladen wird.
Besten Dank für die Hilfe.
Gruss und ein Guter Start in die Woche.
Roger

1
Beitrag zum Forumthread
Beitrag zu diesem Forumthread

Betreff
Benutzer
Anzeige
AW: Listboxeinträge per Doppelklick in Userform laden
13.03.2012 11:17:32
Roger
Habs so gelöst. Funktioniert. Gebe sicher eine einfachere Lösung.
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
UserForm3.TextBox1 = ListBox1.List(ListBox1.ListIndex, 0)
UserForm3.TextBox2 = ListBox1.List(ListBox1.ListIndex, 1)
UserForm3.TextBox3 = ListBox1.List(ListBox1.ListIndex, 2)
UserForm3.TextBox4 = ListBox1.List(ListBox1.ListIndex, 3)
UserForm3.TextBox5 = ListBox1.List(ListBox1.ListIndex, 4)
UserForm3.TextBox6 = ListBox1.List(ListBox1.ListIndex, 5)
UserForm3.TextBox7 = ListBox1.List(ListBox1.ListIndex, 6)
UserForm3.TextBox8 = ListBox1.List(ListBox1.ListIndex, 7)
UserForm3.TextBox9 = ListBox1.List(ListBox1.ListIndex, 8)
UserForm3.TextBox10 = ListBox1.List(ListBox1.ListIndex, 9)
UserForm3.CheckBox1 = ListBox1.List(ListBox1.ListIndex, 10)
UserForm3.CheckBox2 = ListBox1.List(ListBox1.ListIndex, 11)
UserForm3.CheckBox3 = ListBox1.List(ListBox1.ListIndex, 12)
UserForm3.CheckBox4 = ListBox1.List(ListBox1.ListIndex, 13)
UserForm3.CheckBox5 = ListBox1.List(ListBox1.ListIndex, 14)
UserForm3.CheckBox6 = ListBox1.List(ListBox1.ListIndex, 15)
UserForm3.CheckBox7 = ListBox1.List(ListBox1.ListIndex, 16)
UserForm3.CheckBox8 = ListBox1.List(ListBox1.ListIndex, 17)
UserForm3.CheckBox9 = ListBox1.List(ListBox1.ListIndex, 18)
UserForm3.CheckBox10 = ListBox1.List(ListBox1.ListIndex, 19)
UserForm3.CheckBox11 = ListBox1.List(ListBox1.ListIndex, 28)
UserForm3.TextBox11 = ListBox1.List(ListBox1.ListIndex, 20)
UserForm3.TextBox12 = ListBox1.List(ListBox1.ListIndex, 21)
UserForm3.TextBox13 = ListBox1.List(ListBox1.ListIndex, 22)
UserForm3.TextBox14 = ListBox1.List(ListBox1.ListIndex, 23)
UserForm3.TextBox15 = ListBox1.List(ListBox1.ListIndex, 24)
UserForm3.TextBox16 = ListBox1.List(ListBox1.ListIndex, 25)
UserForm3.TextBox17 = ListBox1.List(ListBox1.ListIndex, 26)
UserForm3.TextBox18 = ListBox1.List(ListBox1.ListIndex, 27)
Unload UserForm10
If UserForm3.Visible Then
Else
UserForm3.Show
End If
End Sub

Anzeige

301 Forumthreads zu ähnlichen Themen

Anzeige
Anzeige
Anzeige

Links zu Excel-Dialogen

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige