AW: Button Suchen Beispielmappe
16.11.2010 10:28:31
amintire
Hallo Hary,
die Richtung stimmt, funktioniert auch wunderbar, solange die UserForm in der entsprechenden Tabelle wo gesucht werden muss geöffnet wird.
Habe den Code jetzt so angepasst, aber wie passe ich das an dass er in der anderen Tabelle sucht, hier heißt die Tabelle Mitarbeiter wo die Daten stehen.
Private Sub Suchen_Click()
'Suchfunktion und Ausgabe in Textbox
Dim zelle As Range
Set zelle = ThisWorkbook.Worksheets("Mitarbeiter").Columns("A:V").Find(What:=suche, LookIn:= _
xlValues, lookat:=xlWhole)
If Not zelle Is Nothing Then
TextBox1 = Cells(zelle.Row, 2)
TextBox2 = Cells(zelle.Row, 3)
TextBox3 = Cells(zelle.Row, 1)
TextBox4 = Cells(zelle.Row, 4)
TextBox5 = Cells(zelle.Row, 5)
TextBox6 = Cells(zelle.Row, 6)
TextBox7 = Cells(zelle.Row, 7)
TextBox8 = Cells(zelle.Row, 8)
TextBox9 = Cells(zelle.Row, 9)
TextBox10 = Cells(zelle.Row, 10)
TextBox11 = Cells(zelle.Row, 11)
TextBox12 = Cells(zelle.Row, 12)
TextBox13 = Cells(zelle.Row, 13)
TextBox16 = Cells(zelle.Row, 14)
Else
If MsgBox("Begriff nicht gefunden" & Chr(13) & "möchten Sie neue Daten eingeben", vbYesNo) = _
vbYes Then TextBox1.SetFocus
End If
End Sub
Private Sub TextBox1_Change()
suche = TextBox1.Value
End Sub
Private Sub TextBox2_Change()
suche = TextBox2.Value
End Sub
Private Sub TextBox3_Change()
suche = TextBox3.Value
End Sub
Private Sub TextBox4_Change()
suche = TextBox4.Value
End Sub
Private Sub TextBox5_Change()
suche = TextBox5.Value
End Sub
Private Sub TextBox6_Change()
suche = TextBox6.Value
End Sub
Private Sub TextBox7_Change()
suche = TextBox7.Value
End Sub
Private Sub TextBox8_Change()
suche = TextBox8.Value
End Sub
Private Sub TextBox9_Change()
suche = TextBox9.Value
End Sub
Private Sub TextBox10_Change()
suche = TextBox10.Value
End Sub
Private Sub TextBox11_Change()
suche = TextBox11.Value
End Sub
Private Sub TextBox12_Change()
suche = TextBox12.Value
End Sub
Private Sub TextBox13_Change()
suche = TextBox13.Value
End Sub
Private Sub TextBox16_Change()
suche = TextBox16.Value
End Sub
Lieben Gruß
Amina