View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
MikeR[_2_] MikeR[_2_] is offline
external usenet poster
 
Posts: 13
Default Second search within primary "Find" gives error ?

"Dick Kusleika" wrote in message ...
Mike

You can't nest Finds like that. FindNext will always use the last Find that
you did. So this line

Set Task_Group = .FindNext(Task_Group)

is acutally looking for Std_txt_Number on the Tasks sheet, which it doesn't
find. That makes Task_Group Nothing and you get the error accessing the
Address property of Nothing. For you internal find, you'll have to loop
through the cells on Std_txt instead of using a Find. Althernatively,
instead of using FindNext at the end of Do Loop, you could just redo the
Find specifying the After argument. Instead of

Set Task_Group = .FindNext(Task_Group)

use

Set Task_Group = .Find(GroupNumber,Task_Group,xlValues)

You lose the ease of FindNext, but it may be better than looping through
Std_txt.

--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com

Dick, thanks for the prompt reply.... the "Set Task_Group =
..Find(GroupNumber,Task_Group,xlValues)" << worked first time.... will
remember this for future use ..
many thanks Mike