Hi,
Thanks for the help. I added you suggestions, but there's still a
problem. I think I know what happens now, but I don't know why.
It seems like it goes into an infinite loop or something, because
when I test this by adding FAILED on one cell in the range, the
cursor just turns into a hour class and it goes on and on. When
I interrupt it by pressing Esc, then click the Debug button the
highlight is on different rows almost everytime.
The code works otherwise. When I debug it step by step the
values in the designated cells change to what it should be, but it
just won't stop.
----
mkarja
(E-Mail Removed) wrote:
> Hi
> The .find will give an error if there is no word "PASS" in your range.
> You can suppress the error with
>
> On error resume next
> Set c = .Find("PASS", LookIn:=xlValues)
> If Not c Is Nothing Then
> cnt = 0
> firstAddress = ""
> firstAddress = c.Address
> Do
> cnt = cnt + 1
> Set c = .FindNext(c)
> Loop While Not c Is Nothing And c.Address <> firstAddress
> End If
> on error goto 0
>
> The two wrapping lines make VB ignore the error and go to the next
> line.
> regards
> Paul