.FindNext mag nicht
25.06.2007 17:31:00
Peter
eine von mir ständig verwendete Routine will nicht laufen.
.FindNext wird markiert und VBA sagt:
Fehler beim Kompilieren:
Methode oder Datenobjekt nicht gefunden.
Wo bin ich blind?
Gruß Peter
Private Sub CommandButton5_Click()
Dim WkSh As Worksheet
Dim rZelle As Range
Dim sFundst As String
Dim iLiBox As Integer
Set WkSh = Worksheets("Tabelle1")
With WkSh
If TextBox1.Value "" Then
Set rZelle = WkSh.Columns(2).Find(What:=TextBox1.Value, _
LookIn:=xlValues, Lookat:=xlWhole)
If Not rZelle Is Nothing Then
sFundst = rZelle.Address
Do
With ListBox1
.AddItem " "
.List(iLiBox, 0) = WkSh.Range("A" & rZelle.Row).Value ' Konsolnummer
.List(iLiBox, 1) = WkSh.Range("B" & rZelle.Row).Value ' Lieferschein-Nr.
.List(iLiBox, 2) = WkSh.Range("C" & rZelle.Row).Value ' Lagerort
.List(iLiBox, 3) = rZelle.Row
iLiBox = iLiBox + 1
End With
Set rZelle = .FindNext(rZelle)
Loop While Not rZelle Is Nothing And rZelle.Address sFundst
Else
MsgBox "Zum Suchbegriff """ & TextBox1.Value & """ konnte kein Eintrag " & _
"gefunden werden.", 48, " Hinweis für " & Application.UserName
With TextBox1
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
End With
End If
ElseIf TextBox2.Value "" Then
ElseIf TextBox3.Value "" Then
Else
MsgBox "Es wurde kein Suchbegriff eingegeben!", _
48, " Hinweis für " & Application.UserName
TextBox1.SetFocus
End If
End With
End Sub