Wert suchen incl. Formelergebnis
20.11.2003 07:13:18
Erich M.
habe mit Hilfe des Forum einen Code erstellt, der bestimmte Werte
in einer spalte sucht. Nun habe ich das Problem, wenn ich die Zahl "5"
suche, findet er alle "5" - aber er findet "5" nicht, wenn in der Zelle
die Formel "A1+B1" (= 2+3) hinterlegt ist.
So sieht meine Suche aus:
For Each wks In Worksheets
If wks.Name = tarWks Then GoTo Exitfor
Set rng = wks.Columns(mySpalte).Find(what:=sFind, _
LookAt:=xlWhole, LookIn:=xlFormulas)
If Not rng Is Nothing Then
sAddress = rng.Address
Do
Application.Goto rng, True
' If MsgBox("Weiter und kopieren", vbYesNo + vbQuestion) = vbNo Then Exit Sub
wks.Rows(rng.Row).Copy Destination:=Worksheets(tarWks).Rows(Cr)
Cr = Cr + 1
Set rng = Columns(mySpalte).Cells.FindNext(After:=ActiveCell)
If rng.Address = sAddress Then Exit Do
Loop
End If
Exitfor:
Next wks
Besten Dank für eine Hilfe!
Der gesamte Code siehe hier:
https://www.herber.de/forum/archiv/340to344/t340130.htm
mfg
Erich