Bestandteil Suche
Peter
Rudi hat mir beim erstellen einer kleinen Excelsuchmaschine schon sehr geholfen. Dabei entstand folgender VBA-Code:
Private Sub Schaltfläche3_KlickenSieAuf()
Dim wks As Worksheet, wksStart As Worksheet
Dim rng As Range
Dim sAddress As String, sFind As String
Set wksStart = ActiveSheet
sFind = InputBox("Bitte Suchbegriff eingeben:")
For Each wks In Worksheets
Set rng = wks.Cells.Find( _
what:=sFind, _
lookat:=xlWhole, _
LookIn:=xlFormulas)
If Not rng Is Nothing Then
sAddress = rng.Address
wks.Activate
Do
Application.Goto rng, True
If MsgBox("Weitersuchen?", vbYesNo + vbQuestion) = vbNo Then
wksStart.Activate
Exit Sub
End If
Set rng = Cells.FindNext(after:=ActiveCell)
If rng.Address = sAddress Then Exit Do
Loop
End If
Next wks
MsgBox prompt:="Keine neue Fundstelle!"
wksStart.Activate
End Sub
Nun habe ich aber das Problem dass Zellen die außer dem Suchwort noch andere Daten enthalten nicht angezeigt werden sondern nur Zellen die exakt das Suchwort enthalten. Suche ich also nach "Dreh" werden mir Zellen mit "Drehmoment", "Drehstab" usw. nicht angezeigt.
Gibt es dafür eine Lösung? Vielen Dank im Vorraus.
Grüße
Peter