Suchcode
26.05.2008 10:01:54
Ernst
Hätte da eine Frage wie muss dieser Code aussehen das mir nur der gesuchte eintrag angezeigt wird und nicht wo er mit enthalten ist . zb. ich suche nr:27 und er springt auf 2327 ich möchte aber das er nur auf nr 27 springt.
benutze zur zeit folgenden Code:
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
b = TextBox1.Value
c = Len(b)
x = y
If KeyCode = 13 Then
If c > 1 Then
On Error GoTo ende
Cells.Find(What:=b, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
'Range("P104").Value = b
'TextBox1.Value = ""
Exit Sub
ende:
'TextBox1.Value = ""
MsgBox "Nr. nicht vorhanden !!"
End If
End If
End Sub
Lösungsvorschlag würde mir sehr weiterhelfen !
lg.Ernst