Von |
Dieter |
Am |
13. Februar 2009 um 15:25:28 |
Frage |
Hi, hab da folgendes Prob.
mit ua code kann ich suchen. finde aber nur wenn der gesamte zelleninhalt als suchbegriff eingegeben wird. sonst eben nix. auch wenn ich LookIn:=xlValues ausklammere findet er nur ganze Zeichenketten... kann jemand helfen... danke im voraus
Private Sub CommandButton1_Click() Dim WkSh As Worksheet Dim rZelle As Range
Set WkSh = ThisWorkbook.Worksheets("Tabelle2")
If TextBox1.Value <> "" Then With WkSh.Columns(3) Set rZelle = .Find(TextBox1.Value, LookAt:=xlWhole) ', LookIn:=xlValues) If Not rZelle Is Nothing Then TextBox2.Value = WkSh.Cells(rZelle.Row, 1).Value TextBox3.Value = WkSh.Cells(rZelle.Row, 2).Value TextBox4.Value = WkSh.Cells(rZelle.Row, 4).Value TextBox5.Value = WkSh.Cells(rZelle.Row, 5).Value Else MsgBox "Der gesuchte Begriff """ & TextBox1.Value & _ """ wurde nicht gefunden.", _ 48, " Hinweis für " & Application.UserName TextBox1.SetFocus End If End With Else MsgBox "Sie müssen einen Suchbegriff eingeben - danke." & _ 48, " Hinweis für " & Application.UserName TextBox1.SetFocus End If
End Sub
|
|